diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java deleted file mode 100644 index 2743dee0aa9f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Configuration; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingManagementClient; -import com.azure.resourcemanager.billing.implementation.AddressImpl; -import com.azure.resourcemanager.billing.implementation.AgreementsImpl; -import com.azure.resourcemanager.billing.implementation.AvailableBalancesImpl; -import com.azure.resourcemanager.billing.implementation.BillingAccountsImpl; -import com.azure.resourcemanager.billing.implementation.BillingManagementClientBuilder; -import com.azure.resourcemanager.billing.implementation.BillingPeriodsImpl; -import com.azure.resourcemanager.billing.implementation.BillingPermissionsImpl; -import com.azure.resourcemanager.billing.implementation.BillingProfilesImpl; -import com.azure.resourcemanager.billing.implementation.BillingPropertiesImpl; -import com.azure.resourcemanager.billing.implementation.BillingRoleAssignmentsImpl; -import com.azure.resourcemanager.billing.implementation.BillingRoleDefinitionsImpl; -import com.azure.resourcemanager.billing.implementation.BillingSubscriptionsImpl; -import com.azure.resourcemanager.billing.implementation.CustomersImpl; -import com.azure.resourcemanager.billing.implementation.EnrollmentAccountsImpl; -import com.azure.resourcemanager.billing.implementation.InstructionsImpl; -import com.azure.resourcemanager.billing.implementation.InvoiceSectionsImpl; -import com.azure.resourcemanager.billing.implementation.InvoicesImpl; -import com.azure.resourcemanager.billing.implementation.OperationsImpl; -import com.azure.resourcemanager.billing.implementation.PoliciesImpl; -import com.azure.resourcemanager.billing.implementation.ProductsImpl; -import com.azure.resourcemanager.billing.implementation.ReservationsImpl; -import com.azure.resourcemanager.billing.implementation.TransactionsImpl; -import com.azure.resourcemanager.billing.models.Address; -import com.azure.resourcemanager.billing.models.Agreements; -import com.azure.resourcemanager.billing.models.AvailableBalances; -import com.azure.resourcemanager.billing.models.BillingAccounts; -import com.azure.resourcemanager.billing.models.BillingPeriods; -import com.azure.resourcemanager.billing.models.BillingPermissions; -import com.azure.resourcemanager.billing.models.BillingProfiles; -import com.azure.resourcemanager.billing.models.BillingProperties; -import com.azure.resourcemanager.billing.models.BillingRoleAssignments; -import com.azure.resourcemanager.billing.models.BillingRoleDefinitions; -import com.azure.resourcemanager.billing.models.BillingSubscriptions; -import com.azure.resourcemanager.billing.models.Customers; -import com.azure.resourcemanager.billing.models.EnrollmentAccounts; -import com.azure.resourcemanager.billing.models.Instructions; -import com.azure.resourcemanager.billing.models.InvoiceSections; -import com.azure.resourcemanager.billing.models.Invoices; -import com.azure.resourcemanager.billing.models.Operations; -import com.azure.resourcemanager.billing.models.Policies; -import com.azure.resourcemanager.billing.models.Products; -import com.azure.resourcemanager.billing.models.Reservations; -import com.azure.resourcemanager.billing.models.Transactions; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Entry point to BillingManager. Billing client provides access to billing resources for Azure subscriptions. */ -public final class BillingManager { - private BillingAccounts billingAccounts; - - private Address address; - - private AvailableBalances availableBalances; - - private Instructions instructions; - - private BillingProfiles billingProfiles; - - private Customers customers; - - private InvoiceSections invoiceSections; - - private BillingPermissions billingPermissions; - - private BillingSubscriptions billingSubscriptions; - - private Products products; - - private Invoices invoices; - - private Transactions transactions; - - private Policies policies; - - private BillingProperties billingProperties; - - private Operations operations; - - private BillingRoleDefinitions billingRoleDefinitions; - - private BillingRoleAssignments billingRoleAssignments; - - private Agreements agreements; - - private Reservations reservations; - - private EnrollmentAccounts enrollmentAccounts; - - private BillingPeriods billingPeriods; - - private final BillingManagementClient clientObject; - - private BillingManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new BillingManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of Billing service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Billing service API instance. - */ - public static BillingManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Gets a Configurable instance that can be used to create BillingManager with optional configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new BillingManager.Configurable(); - } - - /** The Configurable allowing configurations to be set. */ - public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private final List scopes = new ArrayList<>(); - private RetryPolicy retryPolicy; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Adds the scope to permission sets. - * - * @param scope the scope. - * @return the configurable object itself. - */ - public Configurable withScope(String scope) { - this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of Billing service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Billing service API instance. - */ - public BillingManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - - StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.billing") - .append("/") - .append("1.0.0-beta.2"); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new RequestIdPolicy()); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies.addAll(this.policies); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new BillingManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** @return Resource collection API of BillingAccounts. */ - public BillingAccounts billingAccounts() { - if (this.billingAccounts == null) { - this.billingAccounts = new BillingAccountsImpl(clientObject.getBillingAccounts(), this); - } - return billingAccounts; - } - - /** @return Resource collection API of Address. */ - public Address address() { - if (this.address == null) { - this.address = new AddressImpl(clientObject.getAddress(), this); - } - return address; - } - - /** @return Resource collection API of AvailableBalances. */ - public AvailableBalances availableBalances() { - if (this.availableBalances == null) { - this.availableBalances = new AvailableBalancesImpl(clientObject.getAvailableBalances(), this); - } - return availableBalances; - } - - /** @return Resource collection API of Instructions. */ - public Instructions instructions() { - if (this.instructions == null) { - this.instructions = new InstructionsImpl(clientObject.getInstructions(), this); - } - return instructions; - } - - /** @return Resource collection API of BillingProfiles. */ - public BillingProfiles billingProfiles() { - if (this.billingProfiles == null) { - this.billingProfiles = new BillingProfilesImpl(clientObject.getBillingProfiles(), this); - } - return billingProfiles; - } - - /** @return Resource collection API of Customers. */ - public Customers customers() { - if (this.customers == null) { - this.customers = new CustomersImpl(clientObject.getCustomers(), this); - } - return customers; - } - - /** @return Resource collection API of InvoiceSections. */ - public InvoiceSections invoiceSections() { - if (this.invoiceSections == null) { - this.invoiceSections = new InvoiceSectionsImpl(clientObject.getInvoiceSections(), this); - } - return invoiceSections; - } - - /** @return Resource collection API of BillingPermissions. */ - public BillingPermissions billingPermissions() { - if (this.billingPermissions == null) { - this.billingPermissions = new BillingPermissionsImpl(clientObject.getBillingPermissions(), this); - } - return billingPermissions; - } - - /** @return Resource collection API of BillingSubscriptions. */ - public BillingSubscriptions billingSubscriptions() { - if (this.billingSubscriptions == null) { - this.billingSubscriptions = new BillingSubscriptionsImpl(clientObject.getBillingSubscriptions(), this); - } - return billingSubscriptions; - } - - /** @return Resource collection API of Products. */ - public Products products() { - if (this.products == null) { - this.products = new ProductsImpl(clientObject.getProducts(), this); - } - return products; - } - - /** @return Resource collection API of Invoices. */ - public Invoices invoices() { - if (this.invoices == null) { - this.invoices = new InvoicesImpl(clientObject.getInvoices(), this); - } - return invoices; - } - - /** @return Resource collection API of Transactions. */ - public Transactions transactions() { - if (this.transactions == null) { - this.transactions = new TransactionsImpl(clientObject.getTransactions(), this); - } - return transactions; - } - - /** @return Resource collection API of Policies. */ - public Policies policies() { - if (this.policies == null) { - this.policies = new PoliciesImpl(clientObject.getPolicies(), this); - } - return policies; - } - - /** @return Resource collection API of BillingProperties. */ - public BillingProperties billingProperties() { - if (this.billingProperties == null) { - this.billingProperties = new BillingPropertiesImpl(clientObject.getBillingProperties(), this); - } - return billingProperties; - } - - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** @return Resource collection API of BillingRoleDefinitions. */ - public BillingRoleDefinitions billingRoleDefinitions() { - if (this.billingRoleDefinitions == null) { - this.billingRoleDefinitions = - new BillingRoleDefinitionsImpl(clientObject.getBillingRoleDefinitions(), this); - } - return billingRoleDefinitions; - } - - /** @return Resource collection API of BillingRoleAssignments. */ - public BillingRoleAssignments billingRoleAssignments() { - if (this.billingRoleAssignments == null) { - this.billingRoleAssignments = - new BillingRoleAssignmentsImpl(clientObject.getBillingRoleAssignments(), this); - } - return billingRoleAssignments; - } - - /** @return Resource collection API of Agreements. */ - public Agreements agreements() { - if (this.agreements == null) { - this.agreements = new AgreementsImpl(clientObject.getAgreements(), this); - } - return agreements; - } - - /** @return Resource collection API of Reservations. */ - public Reservations reservations() { - if (this.reservations == null) { - this.reservations = new ReservationsImpl(clientObject.getReservations(), this); - } - return reservations; - } - - /** @return Resource collection API of EnrollmentAccounts. */ - public EnrollmentAccounts enrollmentAccounts() { - if (this.enrollmentAccounts == null) { - this.enrollmentAccounts = new EnrollmentAccountsImpl(clientObject.getEnrollmentAccounts(), this); - } - return enrollmentAccounts; - } - - /** @return Resource collection API of BillingPeriods. */ - public BillingPeriods billingPeriods() { - if (this.billingPeriods == null) { - this.billingPeriods = new BillingPeriodsImpl(clientObject.getBillingPeriods(), this); - } - return billingPeriods; - } - - /** - * @return Wrapped service client BillingManagementClient providing direct access to the underlying auto-generated - * API implementation, based on Azure REST API. - */ - public BillingManagementClient serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AddressClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AddressClient.java deleted file mode 100644 index 66eecfbbab46..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AddressClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.ValidateAddressResponseInner; -import com.azure.resourcemanager.billing.models.AddressDetails; - -/** An instance of this class provides access to all the operations defined in AddressClient. */ -public interface AddressClient { - /** - * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * - * @param address Address details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the address validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateAddressResponseInner validate(AddressDetails address); - - /** - * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * - * @param address Address details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the address validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse(AddressDetails address, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AgreementsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AgreementsClient.java deleted file mode 100644 index ad29ace3539d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AgreementsClient.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.AgreementInner; - -/** An instance of this class provides access to all the operations defined in AgreementsClient. */ -public interface AgreementsClient { - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the participants. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, String expand, Context context); - - /** - * Gets an agreement by ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agreement by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgreementInner get(String billingAccountName, String agreementName); - - /** - * Gets an agreement by ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. - * @param expand May be used to expand the participants. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agreement by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String agreementName, String expand, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AvailableBalancesClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AvailableBalancesClient.java deleted file mode 100644 index 3b9e3e6df477..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/AvailableBalancesClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner; - -/** An instance of this class provides access to all the operations defined in AvailableBalancesClient. */ -public interface AvailableBalancesClient { - /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now to settle - * due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the latest Azure credit balance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailableBalanceInner get(String billingAccountName, String billingProfileName); - - /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now to settle - * due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the latest Azure credit balance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String billingProfileName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingAccountsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingAccountsClient.java deleted file mode 100644 index 3e8aef58d0e4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingAccountsClient.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.models.BillingAccountInner; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionWithCreateSubPermissionInner; -import com.azure.resourcemanager.billing.models.BillingAccountUpdateRequest; - -/** An instance of this class provides access to all the operations defined in BillingAccountsClient. */ -public interface BillingAccountsClient { - /** - * Lists the billing accounts that a user has access to. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists the billing accounts that a user has access to. - * - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String expand, Context context); - - /** - * Gets a billing account by its ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingAccountInner get(String billingAccountName); - - /** - * Gets a billing account by its ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingAccountName, String expand, Context context); - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BillingAccountInner> beginUpdate( - String billingAccountName, BillingAccountUpdateRequest parameters); - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BillingAccountInner> beginUpdate( - String billingAccountName, BillingAccountUpdateRequest parameters, Context context); - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingAccountInner update(String billingAccountName, BillingAccountUpdateRequest parameters); - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingAccountInner update(String billingAccountName, BillingAccountUpdateRequest parameters, Context context); - - /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInvoiceSectionsByCreateSubscriptionPermission( - String billingAccountName); - - /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listInvoiceSectionsByCreateSubscriptionPermission( - String billingAccountName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingManagementClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingManagementClient.java deleted file mode 100644 index cea1c2b7e376..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingManagementClient.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for BillingManagementClient class. */ -public interface BillingManagementClient { - /** - * Gets The ID that uniquely identifies an Azure subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the BillingAccountsClient object to access its operations. - * - * @return the BillingAccountsClient object. - */ - BillingAccountsClient getBillingAccounts(); - - /** - * Gets the AddressClient object to access its operations. - * - * @return the AddressClient object. - */ - AddressClient getAddress(); - - /** - * Gets the AvailableBalancesClient object to access its operations. - * - * @return the AvailableBalancesClient object. - */ - AvailableBalancesClient getAvailableBalances(); - - /** - * Gets the InstructionsClient object to access its operations. - * - * @return the InstructionsClient object. - */ - InstructionsClient getInstructions(); - - /** - * Gets the BillingProfilesClient object to access its operations. - * - * @return the BillingProfilesClient object. - */ - BillingProfilesClient getBillingProfiles(); - - /** - * Gets the CustomersClient object to access its operations. - * - * @return the CustomersClient object. - */ - CustomersClient getCustomers(); - - /** - * Gets the InvoiceSectionsClient object to access its operations. - * - * @return the InvoiceSectionsClient object. - */ - InvoiceSectionsClient getInvoiceSections(); - - /** - * Gets the BillingPermissionsClient object to access its operations. - * - * @return the BillingPermissionsClient object. - */ - BillingPermissionsClient getBillingPermissions(); - - /** - * Gets the BillingSubscriptionsClient object to access its operations. - * - * @return the BillingSubscriptionsClient object. - */ - BillingSubscriptionsClient getBillingSubscriptions(); - - /** - * Gets the ProductsClient object to access its operations. - * - * @return the ProductsClient object. - */ - ProductsClient getProducts(); - - /** - * Gets the InvoicesClient object to access its operations. - * - * @return the InvoicesClient object. - */ - InvoicesClient getInvoices(); - - /** - * Gets the TransactionsClient object to access its operations. - * - * @return the TransactionsClient object. - */ - TransactionsClient getTransactions(); - - /** - * Gets the PoliciesClient object to access its operations. - * - * @return the PoliciesClient object. - */ - PoliciesClient getPolicies(); - - /** - * Gets the BillingPropertiesClient object to access its operations. - * - * @return the BillingPropertiesClient object. - */ - BillingPropertiesClient getBillingProperties(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the BillingRoleDefinitionsClient object to access its operations. - * - * @return the BillingRoleDefinitionsClient object. - */ - BillingRoleDefinitionsClient getBillingRoleDefinitions(); - - /** - * Gets the BillingRoleAssignmentsClient object to access its operations. - * - * @return the BillingRoleAssignmentsClient object. - */ - BillingRoleAssignmentsClient getBillingRoleAssignments(); - - /** - * Gets the AgreementsClient object to access its operations. - * - * @return the AgreementsClient object. - */ - AgreementsClient getAgreements(); - - /** - * Gets the ReservationsClient object to access its operations. - * - * @return the ReservationsClient object. - */ - ReservationsClient getReservations(); - - /** - * Gets the EnrollmentAccountsClient object to access its operations. - * - * @return the EnrollmentAccountsClient object. - */ - EnrollmentAccountsClient getEnrollmentAccounts(); - - /** - * Gets the BillingPeriodsClient object to access its operations. - * - * @return the BillingPeriodsClient object. - */ - BillingPeriodsClient getBillingPeriods(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPeriodsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPeriodsClient.java deleted file mode 100644 index 9b05db568d5a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPeriodsClient.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; - -/** An instance of this class provides access to all the operations defined in BillingPeriodsClient. */ -public interface BillingPeriodsClient { - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @param filter May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', - * 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, String skiptoken, Integer top, Context context); - - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types - * which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @param billingPeriodName The name of a BillingPeriod resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingPeriodInner get(String billingPeriodName); - - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types - * which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @param billingPeriodName The name of a BillingPeriod resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingPeriodName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPermissionsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPermissionsClient.java deleted file mode 100644 index 806c78a4a825..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPermissionsClient.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; - -/** An instance of this class provides access to all the operations defined in BillingPermissionsClient. */ -public interface BillingPermissionsClient { - /** - * Lists the billing permissions the caller has for a customer. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer(String billingAccountName, String customerName); - - /** - * Lists the billing permissions the caller has for a customer. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context); - - /** - * Lists the billing permissions the caller has on a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the billing permissions the caller has on a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, Context context); - - /** - * Lists the billing permissions the caller has on an invoice section. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSections( - String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Lists the billing permissions the caller has on an invoice section. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSections( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); - - /** - * Lists the billing permissions the caller has on a billing profile. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName); - - /** - * Lists the billing permissions the caller has on a billing profile. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingProfilesClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingProfilesClient.java deleted file mode 100644 index a708b9769226..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingProfilesClient.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; - -/** An instance of this class provides access to all the operations defined in BillingProfilesClient. */ -public interface BillingProfilesClient { - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the invoice sections. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, String expand, Context context); - - /** - * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingProfileInner get(String billingAccountName, String billingProfileName); - - /** - * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param expand May be used to expand the invoice sections. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String billingProfileName, String expand, Context context); - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BillingProfileInner> beginCreateOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters); - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BillingProfileInner> beginCreateOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context); - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingProfileInner createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters); - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingProfileInner createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPropertiesClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPropertiesClient.java deleted file mode 100644 index 6fb632b38e70..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPropertiesClient.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner; - -/** An instance of this class provides access to all the operations defined in BillingPropertiesClient. */ -public interface BillingPropertiesClient { - /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts with - * agreement type Enterprise Agreement. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the billing properties for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingPropertyInner get(); - - /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts with - * agreement type Enterprise Agreement. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the billing properties for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(Context context); - - /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported - * only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param parameters Request parameters that are provided to the update billing property operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing property. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingPropertyInner update(BillingPropertyInner parameters); - - /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported - * only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param parameters Request parameters that are provided to the update billing property operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing property. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(BillingPropertyInner parameters, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleAssignmentsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleAssignmentsClient.java deleted file mode 100644 index 35f767918b95..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleAssignmentsClient.java +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; - -/** An instance of this class provides access to all the operations defined in BillingRoleAssignmentsClient. */ -public interface BillingRoleAssignmentsClient { - /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner getByBillingAccount(String billingAccountName, String billingRoleAssignmentName); - - /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context); - - /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner deleteByBillingAccount(String billingAccountName, String billingRoleAssignmentName); - - /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context); - - /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName); - - /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context); - - /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner deleteByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName); - - /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context); - - /** - * Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName); - - /** - * Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); - - /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleAssignmentInner deleteByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName); - - /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); - - /** - * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, Context context); - - /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); - - /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName); - - /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleDefinitionsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleDefinitionsClient.java deleted file mode 100644 index ae03cfa9580f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingRoleDefinitionsClient.java +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; - -/** An instance of this class provides access to all the operations defined in BillingRoleDefinitionsClient. */ -public interface BillingRoleDefinitionsClient { - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleDefinitionInner getByBillingAccount(String billingAccountName, String billingRoleDefinitionName); - - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleDefinitionName, Context context); - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleDefinitionInner getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName); - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName, - Context context); - - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingRoleDefinitionInner getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName); - - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context); - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, Context context); - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName); - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingSubscriptionsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingSubscriptionsClient.java deleted file mode 100644 index 389c9b9259fe..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingSubscriptionsClient.java +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.azure.resourcemanager.billing.fluent.models.ValidateSubscriptionTransferEligibilityResultInner; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; - -/** An instance of this class provides access to all the operations defined in BillingSubscriptionsClient. */ -public interface BillingSubscriptionsClient { - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer(String billingAccountName, String customerName); - - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context); - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, Context context); - - /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); - - /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); - - /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement and Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a subscription by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingSubscriptionInner get(String billingAccountName); - - /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement and Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a subscription by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingAccountName, Context context); - - /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingSubscriptionInner update(String billingAccountName, BillingSubscriptionInner parameters); - - /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, Context context); - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BillingSubscriptionInner> beginMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters); - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BillingSubscriptionInner> beginMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context); - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingSubscriptionInner move(String billingAccountName, TransferBillingSubscriptionRequestProperties parameters); - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BillingSubscriptionInner move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context); - - /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateSubscriptionTransferEligibilityResultInner validateMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters); - - /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateMoveWithResponse( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/CustomersClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/CustomersClient.java deleted file mode 100644 index 0331888c57e6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/CustomersClient.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.CustomerInner; - -/** An instance of this class provides access to all the operations defined in CustomersClient. */ -public interface CustomersClient { - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String search, String filter, Context context); - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount( - String billingAccountName, String search, String filter, Context context); - - /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft - * Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a customer by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomerInner get(String billingAccountName, String customerName); - - /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft - * Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param expand May be used to expand enabledAzurePlans and resellers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a customer by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String customerName, String expand, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/EnrollmentAccountsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/EnrollmentAccountsClient.java deleted file mode 100644 index 5e167c1f147b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/EnrollmentAccountsClient.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; - -/** An instance of this class provides access to all the operations defined in EnrollmentAccountsClient. */ -public interface EnrollmentAccountsClient { - /** - * Lists the enrollment accounts the caller has access to. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists the enrollment accounts the caller has access to. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EnrollmentAccountSummaryInner get(String name); - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String name, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InstructionsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InstructionsClient.java deleted file mode 100644 index 5b8116658c0b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InstructionsClient.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; - -/** An instance of this class provides access to all the operations defined in InstructionsClient. */ -public interface InstructionsClient { - /** - * Lists the instructions by billing profile id. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the instructions by billing profile id. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); - - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instruction by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InstructionInner get(String billingAccountName, String billingProfileName, String instructionName); - - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instruction by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String billingProfileName, String instructionName, Context context); - - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for certain - * customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instruction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InstructionInner put( - String billingAccountName, String billingProfileName, String instructionName, InstructionInner parameters); - - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for certain - * customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instruction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse( - String billingAccountName, - String billingProfileName, - String instructionName, - InstructionInner parameters, - Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoiceSectionsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoiceSectionsClient.java deleted file mode 100644 index 9681158c5e34..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoiceSectionsClient.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; - -/** An instance of this class provides access to all the operations defined in InvoiceSectionsClient. */ -public interface InvoiceSectionsClient { - /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); - - /** - * Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InvoiceSectionInner get(String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, InvoiceSectionInner> beginCreateOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters); - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, InvoiceSectionInner> beginCreateOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters, - Context context); - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InvoiceSectionInner createOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters); - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InvoiceSectionInner createOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters, - Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoicesClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoicesClient.java deleted file mode 100644 index 2836a300df6b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoicesClient.java +++ /dev/null @@ -1,438 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; -import java.util.List; - -/** An instance of this class provides access to all the operations defined in InvoicesClient. */ -public interface InvoicesClient { - /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate); - - /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate, Context context); - - /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate); - - /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context); - - /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by billing account name and ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InvoiceInner get(String billingAccountName, String invoiceName); - - /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by billing account name and ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingAccountName, String invoiceName, Context context); - - /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InvoiceInner getById(String invoiceName); - - /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByIdWithResponse(String invoiceName, Context context); - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadInvoice( - String billingAccountName, String invoiceName, String downloadToken); - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadInvoice( - String billingAccountName, String invoiceName, String downloadToken, Context context); - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadInvoice(String billingAccountName, String invoiceName, String downloadToken); - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadInvoice( - String billingAccountName, String invoiceName, String downloadToken, Context context); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadMultipleBillingProfileInvoices(String billingAccountName, List downloadUrls); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context); - - /** - * Lists the invoices for a subscription. - * - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingSubscription(String periodStartDate, String periodEndDate); - - /** - * Lists the invoices for a subscription. - * - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingSubscription( - String periodStartDate, String periodEndDate, Context context); - - /** - * Gets an invoice by subscription ID and invoice ID. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by subscription ID and invoice ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InvoiceInner getBySubscriptionAndInvoiceId(String invoiceName); - - /** - * Gets an invoice by subscription ID and invoice ID. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by subscription ID and invoice ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, Context context); - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken); - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken, Context context); - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken); - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken, Context context); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( - List downloadUrls); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( - List downloadUrls, Context context); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadMultipleBillingSubscriptionInvoices(List downloadUrls); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DownloadUrlInner downloadMultipleBillingSubscriptionInvoices(List downloadUrls, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/OperationsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/OperationsClient.java deleted file mode 100644 index 103f7ad487db..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/OperationsClient.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.OperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Lists the available billing REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists the available billing REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/PoliciesClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/PoliciesClient.java deleted file mode 100644 index d6853d3867da..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/PoliciesClient.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; - -/** An instance of this class provides access to all the operations defined in PoliciesClient. */ -public interface PoliciesClient { - /** - * Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyInner getByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, Context context); - - /** - * Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyInner update(String billingAccountName, String billingProfileName, PolicyInner parameters); - - /** - * Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String billingAccountName, String billingProfileName, PolicyInner parameters, Context context); - - /** - * Lists the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomerPolicyInner getByCustomer(String billingAccountName, String customerName); - - /** - * Lists the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByCustomerWithResponse( - String billingAccountName, String customerName, Context context); - - /** - * Updates the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomerPolicyInner updateCustomer(String billingAccountName, String customerName, CustomerPolicyInner parameters); - - /** - * Updates the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateCustomerWithResponse( - String billingAccountName, String customerName, CustomerPolicyInner parameters, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ProductsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ProductsClient.java deleted file mode 100644 index f611f10a553b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ProductsClient.java +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.azure.resourcemanager.billing.fluent.models.ValidateProductTransferEligibilityResultInner; -import com.azure.resourcemanager.billing.models.ProductsMoveResponse; -import com.azure.resourcemanager.billing.models.TransferProductRequestProperties; - -/** An instance of this class provides access to all the operations defined in ProductsClient. */ -public interface ProductsClient { - /** - * Lists the products for a customer. These don't include products billed based on usage.The operation is supported - * only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer(String billingAccountName, String customerName); - - /** - * Lists the products for a customer. These don't include products billed based on usage.The operation is supported - * only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCustomer(String billingAccountName, String customerName, Context context); - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context); - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String filter, Context context); - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context); - - /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProductInner get(String billingAccountName, String productName); - - /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingAccountName, String productName, Context context); - - /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProductInner update(String billingAccountName, String productName, ProductInner parameters); - - /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String billingAccountName, String productName, ProductInner parameters, Context context); - - /** - * Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported only for products that are purchased with a - * recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProductInner move(String billingAccountName, String productName, TransferProductRequestProperties parameters); - - /** - * Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported only for products that are purchased with a - * recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProductsMoveResponse moveWithResponse( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context); - - /** - * Validates if a product's charges can be moved to a new invoice section. This operation is supported only for - * products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the product transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateProductTransferEligibilityResultInner validateMove( - String billingAccountName, String productName, TransferProductRequestProperties parameters); - - /** - * Validates if a product's charges can be moved to a new invoice section. This operation is supported only for - * products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the product transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateMoveWithResponse( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ReservationsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ReservationsClient.java deleted file mode 100644 index db37194db8db..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ReservationsClient.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.ReservationInner; - -/** An instance of this class provides access to all the operations defined in ReservationsClient. */ -public interface ReservationsClient { - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. - * @param selectedState The selected provisioning state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingAccount( - String billingAccountName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context); - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. - * @param selectedState The selected provisioning state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/TransactionsClient.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/TransactionsClient.java deleted file mode 100644 index 403f959e8a87..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/TransactionsClient.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.TransactionInner; - -/** An instance of this class provides access to all the operations defined in TransactionsClient. */ -public interface TransactionsClient { - /** - * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoice(String billingAccountName, String invoiceName); - - /** - * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByInvoice(String billingAccountName, String invoiceName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementInner.java deleted file mode 100644 index 4aaf64e2b001..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementInner.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.AcceptanceMode; -import com.azure.resourcemanager.billing.models.Category; -import com.azure.resourcemanager.billing.models.Participants; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** An agreement. */ -@Fluent -public final class AgreementInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgreementInner.class); - - /* - * The properties of an agreement. - */ - @JsonProperty(value = "properties") - private AgreementProperties innerProperties; - - /** - * Get the innerProperties property: The properties of an agreement. - * - * @return the innerProperties value. - */ - private AgreementProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the agreementLink property: The URL to download the agreement. - * - * @return the agreementLink value. - */ - public String agreementLink() { - return this.innerProperties() == null ? null : this.innerProperties().agreementLink(); - } - - /** - * Get the category property: The category of the agreement signed by a customer. - * - * @return the category value. - */ - public Category category() { - return this.innerProperties() == null ? null : this.innerProperties().category(); - } - - /** - * Get the acceptanceMode property: The mode of acceptance for an agreement. - * - * @return the acceptanceMode value. - */ - public AcceptanceMode acceptanceMode() { - return this.innerProperties() == null ? null : this.innerProperties().acceptanceMode(); - } - - /** - * Get the effectiveDate property: The date from which the agreement is effective. - * - * @return the effectiveDate value. - */ - public OffsetDateTime effectiveDate() { - return this.innerProperties() == null ? null : this.innerProperties().effectiveDate(); - } - - /** - * Get the expirationDate property: The date when the agreement expires. - * - * @return the expirationDate value. - */ - public OffsetDateTime expirationDate() { - return this.innerProperties() == null ? null : this.innerProperties().expirationDate(); - } - - /** - * Get the participants property: The list of participants that participates in acceptance of an agreement. - * - * @return the participants value. - */ - public List participants() { - return this.innerProperties() == null ? null : this.innerProperties().participants(); - } - - /** - * Set the participants property: The list of participants that participates in acceptance of an agreement. - * - * @param participants the participants value to set. - * @return the AgreementInner object itself. - */ - public AgreementInner withParticipants(List participants) { - if (this.innerProperties() == null) { - this.innerProperties = new AgreementProperties(); - } - this.innerProperties().withParticipants(participants); - return this; - } - - /** - * Get the status property: The current status of the agreement. - * - * @return the status value. - */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementProperties.java deleted file mode 100644 index 2c58990d8f54..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementProperties.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.AcceptanceMode; -import com.azure.resourcemanager.billing.models.Category; -import com.azure.resourcemanager.billing.models.Participants; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The properties of an agreement. */ -@Fluent -public final class AgreementProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgreementProperties.class); - - /* - * The URL to download the agreement. - */ - @JsonProperty(value = "agreementLink", access = JsonProperty.Access.WRITE_ONLY) - private String agreementLink; - - /* - * The category of the agreement signed by a customer. - */ - @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) - private Category category; - - /* - * The mode of acceptance for an agreement. - */ - @JsonProperty(value = "acceptanceMode", access = JsonProperty.Access.WRITE_ONLY) - private AcceptanceMode acceptanceMode; - - /* - * The date from which the agreement is effective. - */ - @JsonProperty(value = "effectiveDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime effectiveDate; - - /* - * The date when the agreement expires. - */ - @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expirationDate; - - /* - * The list of participants that participates in acceptance of an - * agreement. - */ - @JsonProperty(value = "participants") - private List participants; - - /* - * The current status of the agreement. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /** - * Get the agreementLink property: The URL to download the agreement. - * - * @return the agreementLink value. - */ - public String agreementLink() { - return this.agreementLink; - } - - /** - * Get the category property: The category of the agreement signed by a customer. - * - * @return the category value. - */ - public Category category() { - return this.category; - } - - /** - * Get the acceptanceMode property: The mode of acceptance for an agreement. - * - * @return the acceptanceMode value. - */ - public AcceptanceMode acceptanceMode() { - return this.acceptanceMode; - } - - /** - * Get the effectiveDate property: The date from which the agreement is effective. - * - * @return the effectiveDate value. - */ - public OffsetDateTime effectiveDate() { - return this.effectiveDate; - } - - /** - * Get the expirationDate property: The date when the agreement expires. - * - * @return the expirationDate value. - */ - public OffsetDateTime expirationDate() { - return this.expirationDate; - } - - /** - * Get the participants property: The list of participants that participates in acceptance of an agreement. - * - * @return the participants value. - */ - public List participants() { - return this.participants; - } - - /** - * Set the participants property: The list of participants that participates in acceptance of an agreement. - * - * @param participants the participants value to set. - * @return the AgreementProperties object itself. - */ - public AgreementProperties withParticipants(List participants) { - this.participants = participants; - return this; - } - - /** - * Get the status property: The current status of the agreement. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (participants() != null) { - participants().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AvailableBalanceInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AvailableBalanceInner.java deleted file mode 100644 index 227613aced33..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AvailableBalanceInner.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Amount; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The latest Azure credit balance. This is the balance available for pay now. */ -@Fluent -public final class AvailableBalanceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableBalanceInner.class); - - /* - * The properties of available balance. - */ - @JsonProperty(value = "properties") - private AvailableBalanceProperties innerProperties; - - /** - * Get the innerProperties property: The properties of available balance. - * - * @return the innerProperties value. - */ - private AvailableBalanceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the amount property: Balance amount. - * - * @return the amount value. - */ - public Amount amount() { - return this.innerProperties() == null ? null : this.innerProperties().amount(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AvailableBalanceProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AvailableBalanceProperties.java deleted file mode 100644 index 9e48931341e3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AvailableBalanceProperties.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Amount; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of available balance. */ -@Immutable -public final class AvailableBalanceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableBalanceProperties.class); - - /* - * Balance amount. - */ - @JsonProperty(value = "amount", access = JsonProperty.Access.WRITE_ONLY) - private Amount amount; - - /** - * Get the amount property: Balance amount. - * - * @return the amount value. - */ - public Amount amount() { - return this.amount; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (amount() != null) { - amount().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountInner.java deleted file mode 100644 index f119d957031d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountInner.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.AccountStatus; -import com.azure.resourcemanager.billing.models.AccountType; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.AgreementType; -import com.azure.resourcemanager.billing.models.BillingProfilesOnExpand; -import com.azure.resourcemanager.billing.models.Department; -import com.azure.resourcemanager.billing.models.Enrollment; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A billing account. */ -@Fluent -public final class BillingAccountInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingAccountInner.class); - - /* - * The properties of the billing account. - */ - @JsonProperty(value = "properties") - private BillingAccountProperties innerProperties; - - /** - * Get the innerProperties property: The properties of the billing account. - * - * @return the innerProperties value. - */ - private BillingAccountProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: The billing account name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The billing account name. - * - * @param displayName the displayName value to set. - * @return the BillingAccountInner object itself. - */ - public BillingAccountInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @return the soldTo value. - */ - public AddressDetails soldTo() { - return this.innerProperties() == null ? null : this.innerProperties().soldTo(); - } - - /** - * Set the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @param soldTo the soldTo value to set. - * @return the BillingAccountInner object itself. - */ - public BillingAccountInner withSoldTo(AddressDetails soldTo) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withSoldTo(soldTo); - return this; - } - - /** - * Get the agreementType property: The type of agreement. - * - * @return the agreementType value. - */ - public AgreementType agreementType() { - return this.innerProperties() == null ? null : this.innerProperties().agreementType(); - } - - /** - * Get the accountType property: The type of customer. - * - * @return the accountType value. - */ - public AccountType accountType() { - return this.innerProperties() == null ? null : this.innerProperties().accountType(); - } - - /** - * Get the accountStatus property: The current status of the billing account. - * - * @return the accountStatus value. - */ - public AccountStatus accountStatus() { - return this.innerProperties() == null ? null : this.innerProperties().accountStatus(); - } - - /** - * Get the billingProfiles property: The billing profiles associated with the billing account. By default this is - * not populated, unless it's specified in $expand. - * - * @return the billingProfiles value. - */ - public BillingProfilesOnExpand billingProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfiles(); - } - - /** - * Set the billingProfiles property: The billing profiles associated with the billing account. By default this is - * not populated, unless it's specified in $expand. - * - * @param billingProfiles the billingProfiles value to set. - * @return the BillingAccountInner object itself. - */ - public BillingAccountInner withBillingProfiles(BillingProfilesOnExpand billingProfiles) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withBillingProfiles(billingProfiles); - return this; - } - - /** - * Get the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not - * populated, unless it's specified in $expand. - * - * @return the enrollmentDetails value. - */ - public Enrollment enrollmentDetails() { - return this.innerProperties() == null ? null : this.innerProperties().enrollmentDetails(); - } - - /** - * Get the departments property: The departments associated to the enrollment. - * - * @return the departments value. - */ - public List departments() { - return this.innerProperties() == null ? null : this.innerProperties().departments(); - } - - /** - * Set the departments property: The departments associated to the enrollment. - * - * @param departments the departments value to set. - * @return the BillingAccountInner object itself. - */ - public BillingAccountInner withDepartments(List departments) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withDepartments(departments); - return this; - } - - /** - * Get the enrollmentAccounts property: The accounts associated to the enrollment. - * - * @return the enrollmentAccounts value. - */ - public List enrollmentAccounts() { - return this.innerProperties() == null ? null : this.innerProperties().enrollmentAccounts(); - } - - /** - * Set the enrollmentAccounts property: The accounts associated to the enrollment. - * - * @param enrollmentAccounts the enrollmentAccounts value to set. - * @return the BillingAccountInner object itself. - */ - public BillingAccountInner withEnrollmentAccounts(List enrollmentAccounts) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withEnrollmentAccounts(enrollmentAccounts); - return this; - } - - /** - * Get the hasReadAccess property: Indicates whether user has read access to the billing account. - * - * @return the hasReadAccess value. - */ - public Boolean hasReadAccess() { - return this.innerProperties() == null ? null : this.innerProperties().hasReadAccess(); - } - - /** - * Get the notificationEmailAddress property: Notification email address, only for legacy accounts. - * - * @return the notificationEmailAddress value. - */ - public String notificationEmailAddress() { - return this.innerProperties() == null ? null : this.innerProperties().notificationEmailAddress(); - } - - /** - * Set the notificationEmailAddress property: Notification email address, only for legacy accounts. - * - * @param notificationEmailAddress the notificationEmailAddress value to set. - * @return the BillingAccountInner object itself. - */ - public BillingAccountInner withNotificationEmailAddress(String notificationEmailAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withNotificationEmailAddress(notificationEmailAddress); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountProperties.java deleted file mode 100644 index d8a9019f1b23..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountProperties.java +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.AccountStatus; -import com.azure.resourcemanager.billing.models.AccountType; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.AgreementType; -import com.azure.resourcemanager.billing.models.BillingProfilesOnExpand; -import com.azure.resourcemanager.billing.models.Department; -import com.azure.resourcemanager.billing.models.Enrollment; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of the billing account. */ -@Fluent -public final class BillingAccountProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingAccountProperties.class); - - /* - * The billing account name. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The address of the individual or organization that is responsible for - * the billing account. - */ - @JsonProperty(value = "soldTo") - private AddressDetails soldTo; - - /* - * The type of agreement. - */ - @JsonProperty(value = "agreementType", access = JsonProperty.Access.WRITE_ONLY) - private AgreementType agreementType; - - /* - * The type of customer. - */ - @JsonProperty(value = "accountType", access = JsonProperty.Access.WRITE_ONLY) - private AccountType accountType; - - /* - * The current status of the billing account. - */ - @JsonProperty(value = "accountStatus", access = JsonProperty.Access.WRITE_ONLY) - private AccountStatus accountStatus; - - /* - * The billing profiles associated with the billing account. By default - * this is not populated, unless it's specified in $expand. - */ - @JsonProperty(value = "billingProfiles") - private BillingProfilesOnExpand billingProfiles; - - /* - * The details about the associated legacy enrollment. By default this is - * not populated, unless it's specified in $expand. - */ - @JsonProperty(value = "enrollmentDetails", access = JsonProperty.Access.WRITE_ONLY) - private Enrollment enrollmentDetails; - - /* - * The departments associated to the enrollment. - */ - @JsonProperty(value = "departments") - private List departments; - - /* - * The accounts associated to the enrollment. - */ - @JsonProperty(value = "enrollmentAccounts") - private List enrollmentAccounts; - - /* - * Indicates whether user has read access to the billing account. - */ - @JsonProperty(value = "hasReadAccess", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasReadAccess; - - /* - * Notification email address, only for legacy accounts - */ - @JsonProperty(value = "notificationEmailAddress") - private String notificationEmailAddress; - - /** - * Get the displayName property: The billing account name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The billing account name. - * - * @param displayName the displayName value to set. - * @return the BillingAccountProperties object itself. - */ - public BillingAccountProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @return the soldTo value. - */ - public AddressDetails soldTo() { - return this.soldTo; - } - - /** - * Set the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @param soldTo the soldTo value to set. - * @return the BillingAccountProperties object itself. - */ - public BillingAccountProperties withSoldTo(AddressDetails soldTo) { - this.soldTo = soldTo; - return this; - } - - /** - * Get the agreementType property: The type of agreement. - * - * @return the agreementType value. - */ - public AgreementType agreementType() { - return this.agreementType; - } - - /** - * Get the accountType property: The type of customer. - * - * @return the accountType value. - */ - public AccountType accountType() { - return this.accountType; - } - - /** - * Get the accountStatus property: The current status of the billing account. - * - * @return the accountStatus value. - */ - public AccountStatus accountStatus() { - return this.accountStatus; - } - - /** - * Get the billingProfiles property: The billing profiles associated with the billing account. By default this is - * not populated, unless it's specified in $expand. - * - * @return the billingProfiles value. - */ - public BillingProfilesOnExpand billingProfiles() { - return this.billingProfiles; - } - - /** - * Set the billingProfiles property: The billing profiles associated with the billing account. By default this is - * not populated, unless it's specified in $expand. - * - * @param billingProfiles the billingProfiles value to set. - * @return the BillingAccountProperties object itself. - */ - public BillingAccountProperties withBillingProfiles(BillingProfilesOnExpand billingProfiles) { - this.billingProfiles = billingProfiles; - return this; - } - - /** - * Get the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not - * populated, unless it's specified in $expand. - * - * @return the enrollmentDetails value. - */ - public Enrollment enrollmentDetails() { - return this.enrollmentDetails; - } - - /** - * Get the departments property: The departments associated to the enrollment. - * - * @return the departments value. - */ - public List departments() { - return this.departments; - } - - /** - * Set the departments property: The departments associated to the enrollment. - * - * @param departments the departments value to set. - * @return the BillingAccountProperties object itself. - */ - public BillingAccountProperties withDepartments(List departments) { - this.departments = departments; - return this; - } - - /** - * Get the enrollmentAccounts property: The accounts associated to the enrollment. - * - * @return the enrollmentAccounts value. - */ - public List enrollmentAccounts() { - return this.enrollmentAccounts; - } - - /** - * Set the enrollmentAccounts property: The accounts associated to the enrollment. - * - * @param enrollmentAccounts the enrollmentAccounts value to set. - * @return the BillingAccountProperties object itself. - */ - public BillingAccountProperties withEnrollmentAccounts(List enrollmentAccounts) { - this.enrollmentAccounts = enrollmentAccounts; - return this; - } - - /** - * Get the hasReadAccess property: Indicates whether user has read access to the billing account. - * - * @return the hasReadAccess value. - */ - public Boolean hasReadAccess() { - return this.hasReadAccess; - } - - /** - * Get the notificationEmailAddress property: Notification email address, only for legacy accounts. - * - * @return the notificationEmailAddress value. - */ - public String notificationEmailAddress() { - return this.notificationEmailAddress; - } - - /** - * Set the notificationEmailAddress property: Notification email address, only for legacy accounts. - * - * @param notificationEmailAddress the notificationEmailAddress value to set. - * @return the BillingAccountProperties object itself. - */ - public BillingAccountProperties withNotificationEmailAddress(String notificationEmailAddress) { - this.notificationEmailAddress = notificationEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (soldTo() != null) { - soldTo().validate(); - } - if (billingProfiles() != null) { - billingProfiles().validate(); - } - if (enrollmentDetails() != null) { - enrollmentDetails().validate(); - } - if (departments() != null) { - departments().forEach(e -> e.validate()); - } - if (enrollmentAccounts() != null) { - enrollmentAccounts().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodInner.java deleted file mode 100644 index fc81c5f3a2a8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodInner.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.LocalDate; -import java.util.List; - -/** A billing period resource. */ -@Fluent -public final class BillingPeriodInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingPeriodInner.class); - - /* - * A billing period. - */ - @JsonProperty(value = "properties") - private BillingPeriodProperties innerProperties; - - /** - * Get the innerProperties property: A billing period. - * - * @return the innerProperties value. - */ - private BillingPeriodProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the billingPeriodStartDate property: The start of the date range covered by the billing period. - * - * @return the billingPeriodStartDate value. - */ - public LocalDate billingPeriodStartDate() { - return this.innerProperties() == null ? null : this.innerProperties().billingPeriodStartDate(); - } - - /** - * Get the billingPeriodEndDate property: The end of the date range covered by the billing period. - * - * @return the billingPeriodEndDate value. - */ - public LocalDate billingPeriodEndDate() { - return this.innerProperties() == null ? null : this.innerProperties().billingPeriodEndDate(); - } - - /** - * Get the invoiceIds property: Array of invoice ids that associated with. - * - * @return the invoiceIds value. - */ - public List invoiceIds() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceIds(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodProperties.java deleted file mode 100644 index 527f21fc77ef..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPeriodProperties.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.LocalDate; -import java.util.List; - -/** The properties of the billing period. */ -@Immutable -public final class BillingPeriodProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingPeriodProperties.class); - - /* - * The start of the date range covered by the billing period. - */ - @JsonProperty(value = "billingPeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) - private LocalDate billingPeriodStartDate; - - /* - * The end of the date range covered by the billing period. - */ - @JsonProperty(value = "billingPeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) - private LocalDate billingPeriodEndDate; - - /* - * Array of invoice ids that associated with. - */ - @JsonProperty(value = "invoiceIds", access = JsonProperty.Access.WRITE_ONLY) - private List invoiceIds; - - /** - * Get the billingPeriodStartDate property: The start of the date range covered by the billing period. - * - * @return the billingPeriodStartDate value. - */ - public LocalDate billingPeriodStartDate() { - return this.billingPeriodStartDate; - } - - /** - * Get the billingPeriodEndDate property: The end of the date range covered by the billing period. - * - * @return the billingPeriodEndDate value. - */ - public LocalDate billingPeriodEndDate() { - return this.billingPeriodEndDate; - } - - /** - * Get the invoiceIds property: Array of invoice ids that associated with. - * - * @return the invoiceIds value. - */ - public List invoiceIds() { - return this.invoiceIds; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPermissionsPropertiesInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPermissionsPropertiesInner.java deleted file mode 100644 index b44d405928f9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPermissionsPropertiesInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The set of allowed action and not allowed actions a caller has on a billing account. */ -@Immutable -public final class BillingPermissionsPropertiesInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingPermissionsPropertiesInner.class); - - /* - * The set of actions that the caller is allowed to perform. - */ - @JsonProperty(value = "actions", access = JsonProperty.Access.WRITE_ONLY) - private List actions; - - /* - * The set of actions that the caller is not allowed to perform. - */ - @JsonProperty(value = "notActions", access = JsonProperty.Access.WRITE_ONLY) - private List notActions; - - /** - * Get the actions property: The set of actions that the caller is allowed to perform. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Get the notActions property: The set of actions that the caller is not allowed to perform. - * - * @return the notActions value. - */ - public List notActions() { - return this.notActions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileInner.java deleted file mode 100644 index a54bd6c8e17f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileInner.java +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.BillingProfileStatus; -import com.azure.resourcemanager.billing.models.BillingRelationshipType; -import com.azure.resourcemanager.billing.models.IndirectRelationshipInfo; -import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpand; -import com.azure.resourcemanager.billing.models.SpendingLimit; -import com.azure.resourcemanager.billing.models.StatusReasonCode; -import com.azure.resourcemanager.billing.models.TargetCloud; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A billing profile. */ -@Fluent -public final class BillingProfileInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingProfileInner.class); - - /* - * The properties of the billing profile. - */ - @JsonProperty(value = "properties") - private BillingProfileProperties innerProperties; - - /** - * Get the innerProperties property: The properties of the billing profile. - * - * @return the innerProperties value. - */ - private BillingProfileProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: The name of the billing profile. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The name of the billing profile. - * - * @param displayName the displayName value to set. - * @return the BillingProfileInner object itself. - */ - public BillingProfileInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the poNumber property: The purchase order name that will appear on the invoices generated for the billing - * profile. - * - * @return the poNumber value. - */ - public String poNumber() { - return this.innerProperties() == null ? null : this.innerProperties().poNumber(); - } - - /** - * Set the poNumber property: The purchase order name that will appear on the invoices generated for the billing - * profile. - * - * @param poNumber the poNumber value to set. - * @return the BillingProfileInner object itself. - */ - public BillingProfileInner withPoNumber(String poNumber) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); - } - this.innerProperties().withPoNumber(poNumber); - return this; - } - - /** - * Get the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. - * - * @return the billingRelationshipType value. - */ - public BillingRelationshipType billingRelationshipType() { - return this.innerProperties() == null ? null : this.innerProperties().billingRelationshipType(); - } - - /** - * Get the billTo property: Billing address. - * - * @return the billTo value. - */ - public AddressDetails billTo() { - return this.innerProperties() == null ? null : this.innerProperties().billTo(); - } - - /** - * Set the billTo property: Billing address. - * - * @param billTo the billTo value to set. - * @return the BillingProfileInner object itself. - */ - public BillingProfileInner withBillTo(AddressDetails billTo) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); - } - this.innerProperties().withBillTo(billTo); - return this; - } - - /** - * Get the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing - * profile in indirect purchase motion. - * - * @return the indirectRelationshipInfo value. - */ - public IndirectRelationshipInfo indirectRelationshipInfo() { - return this.innerProperties() == null ? null : this.innerProperties().indirectRelationshipInfo(); - } - - /** - * Get the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent - * through email. - * - * @return the invoiceEmailOptIn value. - */ - public Boolean invoiceEmailOptIn() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceEmailOptIn(); - } - - /** - * Set the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent - * through email. - * - * @param invoiceEmailOptIn the invoiceEmailOptIn value to set. - * @return the BillingProfileInner object itself. - */ - public BillingProfileInner withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); - } - this.innerProperties().withInvoiceEmailOptIn(invoiceEmailOptIn); - return this; - } - - /** - * Get the invoiceDay property: The day of the month when the invoice for the billing profile is generated. - * - * @return the invoiceDay value. - */ - public Integer invoiceDay() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceDay(); - } - - /** - * Get the currency property: The currency in which the charges for the billing profile are billed. - * - * @return the currency value. - */ - public String currency() { - return this.innerProperties() == null ? null : this.innerProperties().currency(); - } - - /** - * Get the enabledAzurePlans property: Information about the enabled azure plans. - * - * @return the enabledAzurePlans value. - */ - public List enabledAzurePlans() { - return this.innerProperties() == null ? null : this.innerProperties().enabledAzurePlans(); - } - - /** - * Set the enabledAzurePlans property: Information about the enabled azure plans. - * - * @param enabledAzurePlans the enabledAzurePlans value to set. - * @return the BillingProfileInner object itself. - */ - public BillingProfileInner withEnabledAzurePlans(List enabledAzurePlans) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); - } - this.innerProperties().withEnabledAzurePlans(enabledAzurePlans); - return this; - } - - /** - * Get the invoiceSections property: The invoice sections associated to the billing profile. By default this is not - * populated, unless it's specified in $expand. - * - * @return the invoiceSections value. - */ - public InvoiceSectionsOnExpand invoiceSections() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSections(); - } - - /** - * Set the invoiceSections property: The invoice sections associated to the billing profile. By default this is not - * populated, unless it's specified in $expand. - * - * @param invoiceSections the invoiceSections value to set. - * @return the BillingProfileInner object itself. - */ - public BillingProfileInner withInvoiceSections(InvoiceSectionsOnExpand invoiceSections) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); - } - this.innerProperties().withInvoiceSections(invoiceSections); - return this; - } - - /** - * Get the hasReadAccess property: Indicates whether user has read access to the billing profile. - * - * @return the hasReadAccess value. - */ - public Boolean hasReadAccess() { - return this.innerProperties() == null ? null : this.innerProperties().hasReadAccess(); - } - - /** - * Get the systemId property: The system generated unique identifier for a billing profile. - * - * @return the systemId value. - */ - public String systemId() { - return this.innerProperties() == null ? null : this.innerProperties().systemId(); - } - - /** - * Get the status property: The status of the billing profile. - * - * @return the status value. - */ - public BillingProfileStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the statusReasonCode property: Reason for the specified billing profile status. - * - * @return the statusReasonCode value. - */ - public StatusReasonCode statusReasonCode() { - return this.innerProperties() == null ? null : this.innerProperties().statusReasonCode(); - } - - /** - * Get the spendingLimit property: The billing profile spending limit. - * - * @return the spendingLimit value. - */ - public SpendingLimit spendingLimit() { - return this.innerProperties() == null ? null : this.innerProperties().spendingLimit(); - } - - /** - * Get the targetClouds property: Identifies the cloud environments that are associated with a billing profile. This - * is a system managed optional field and gets updated as the billing profile gets associated with accounts in - * various clouds. - * - * @return the targetClouds value. - */ - public List targetClouds() { - return this.innerProperties() == null ? null : this.innerProperties().targetClouds(); - } - - /** - * Get the tags property: Tags of billing profiles. - * - * @return the tags value. - */ - public Map tags() { - return this.innerProperties() == null ? null : this.innerProperties().tags(); - } - - /** - * Set the tags property: Tags of billing profiles. - * - * @param tags the tags value to set. - * @return the BillingProfileInner object itself. - */ - public BillingProfileInner withTags(Map tags) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingProfileProperties(); - } - this.innerProperties().withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileProperties.java deleted file mode 100644 index f250f2508e07..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileProperties.java +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.BillingProfileStatus; -import com.azure.resourcemanager.billing.models.BillingRelationshipType; -import com.azure.resourcemanager.billing.models.IndirectRelationshipInfo; -import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpand; -import com.azure.resourcemanager.billing.models.SpendingLimit; -import com.azure.resourcemanager.billing.models.StatusReasonCode; -import com.azure.resourcemanager.billing.models.TargetCloud; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The properties of the billing profile. */ -@Fluent -public final class BillingProfileProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingProfileProperties.class); - - /* - * The name of the billing profile. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The purchase order name that will appear on the invoices generated for - * the billing profile. - */ - @JsonProperty(value = "poNumber") - private String poNumber; - - /* - * Identifies which services and purchases are paid by a billing profile. - */ - @JsonProperty(value = "billingRelationshipType", access = JsonProperty.Access.WRITE_ONLY) - private BillingRelationshipType billingRelationshipType; - - /* - * Billing address. - */ - @JsonProperty(value = "billTo") - private AddressDetails billTo; - - /* - * Identifies the billing profile that is linked to another billing profile - * in indirect purchase motion. - */ - @JsonProperty(value = "indirectRelationshipInfo", access = JsonProperty.Access.WRITE_ONLY) - private IndirectRelationshipInfo indirectRelationshipInfo; - - /* - * Flag controlling whether the invoices for the billing profile are sent - * through email. - */ - @JsonProperty(value = "invoiceEmailOptIn") - private Boolean invoiceEmailOptIn; - - /* - * The day of the month when the invoice for the billing profile is - * generated. - */ - @JsonProperty(value = "invoiceDay", access = JsonProperty.Access.WRITE_ONLY) - private Integer invoiceDay; - - /* - * The currency in which the charges for the billing profile are billed. - */ - @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; - - /* - * Information about the enabled azure plans. - */ - @JsonProperty(value = "enabledAzurePlans") - private List enabledAzurePlans; - - /* - * The invoice sections associated to the billing profile. By default this - * is not populated, unless it's specified in $expand. - */ - @JsonProperty(value = "invoiceSections") - private InvoiceSectionsOnExpand invoiceSections; - - /* - * Indicates whether user has read access to the billing profile. - */ - @JsonProperty(value = "hasReadAccess", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasReadAccess; - - /* - * The system generated unique identifier for a billing profile. - */ - @JsonProperty(value = "systemId", access = JsonProperty.Access.WRITE_ONLY) - private String systemId; - - /* - * The status of the billing profile. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private BillingProfileStatus status; - - /* - * Reason for the specified billing profile status. - */ - @JsonProperty(value = "statusReasonCode", access = JsonProperty.Access.WRITE_ONLY) - private StatusReasonCode statusReasonCode; - - /* - * The billing profile spending limit. - */ - @JsonProperty(value = "spendingLimit", access = JsonProperty.Access.WRITE_ONLY) - private SpendingLimit spendingLimit; - - /* - * Identifies the cloud environments that are associated with a billing - * profile. This is a system managed optional field and gets updated as the - * billing profile gets associated with accounts in various clouds. - */ - @JsonProperty(value = "targetClouds", access = JsonProperty.Access.WRITE_ONLY) - private List targetClouds; - - /* - * Tags of billing profiles. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the displayName property: The name of the billing profile. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The name of the billing profile. - * - * @param displayName the displayName value to set. - * @return the BillingProfileProperties object itself. - */ - public BillingProfileProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the poNumber property: The purchase order name that will appear on the invoices generated for the billing - * profile. - * - * @return the poNumber value. - */ - public String poNumber() { - return this.poNumber; - } - - /** - * Set the poNumber property: The purchase order name that will appear on the invoices generated for the billing - * profile. - * - * @param poNumber the poNumber value to set. - * @return the BillingProfileProperties object itself. - */ - public BillingProfileProperties withPoNumber(String poNumber) { - this.poNumber = poNumber; - return this; - } - - /** - * Get the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. - * - * @return the billingRelationshipType value. - */ - public BillingRelationshipType billingRelationshipType() { - return this.billingRelationshipType; - } - - /** - * Get the billTo property: Billing address. - * - * @return the billTo value. - */ - public AddressDetails billTo() { - return this.billTo; - } - - /** - * Set the billTo property: Billing address. - * - * @param billTo the billTo value to set. - * @return the BillingProfileProperties object itself. - */ - public BillingProfileProperties withBillTo(AddressDetails billTo) { - this.billTo = billTo; - return this; - } - - /** - * Get the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing - * profile in indirect purchase motion. - * - * @return the indirectRelationshipInfo value. - */ - public IndirectRelationshipInfo indirectRelationshipInfo() { - return this.indirectRelationshipInfo; - } - - /** - * Get the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent - * through email. - * - * @return the invoiceEmailOptIn value. - */ - public Boolean invoiceEmailOptIn() { - return this.invoiceEmailOptIn; - } - - /** - * Set the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent - * through email. - * - * @param invoiceEmailOptIn the invoiceEmailOptIn value to set. - * @return the BillingProfileProperties object itself. - */ - public BillingProfileProperties withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) { - this.invoiceEmailOptIn = invoiceEmailOptIn; - return this; - } - - /** - * Get the invoiceDay property: The day of the month when the invoice for the billing profile is generated. - * - * @return the invoiceDay value. - */ - public Integer invoiceDay() { - return this.invoiceDay; - } - - /** - * Get the currency property: The currency in which the charges for the billing profile are billed. - * - * @return the currency value. - */ - public String currency() { - return this.currency; - } - - /** - * Get the enabledAzurePlans property: Information about the enabled azure plans. - * - * @return the enabledAzurePlans value. - */ - public List enabledAzurePlans() { - return this.enabledAzurePlans; - } - - /** - * Set the enabledAzurePlans property: Information about the enabled azure plans. - * - * @param enabledAzurePlans the enabledAzurePlans value to set. - * @return the BillingProfileProperties object itself. - */ - public BillingProfileProperties withEnabledAzurePlans(List enabledAzurePlans) { - this.enabledAzurePlans = enabledAzurePlans; - return this; - } - - /** - * Get the invoiceSections property: The invoice sections associated to the billing profile. By default this is not - * populated, unless it's specified in $expand. - * - * @return the invoiceSections value. - */ - public InvoiceSectionsOnExpand invoiceSections() { - return this.invoiceSections; - } - - /** - * Set the invoiceSections property: The invoice sections associated to the billing profile. By default this is not - * populated, unless it's specified in $expand. - * - * @param invoiceSections the invoiceSections value to set. - * @return the BillingProfileProperties object itself. - */ - public BillingProfileProperties withInvoiceSections(InvoiceSectionsOnExpand invoiceSections) { - this.invoiceSections = invoiceSections; - return this; - } - - /** - * Get the hasReadAccess property: Indicates whether user has read access to the billing profile. - * - * @return the hasReadAccess value. - */ - public Boolean hasReadAccess() { - return this.hasReadAccess; - } - - /** - * Get the systemId property: The system generated unique identifier for a billing profile. - * - * @return the systemId value. - */ - public String systemId() { - return this.systemId; - } - - /** - * Get the status property: The status of the billing profile. - * - * @return the status value. - */ - public BillingProfileStatus status() { - return this.status; - } - - /** - * Get the statusReasonCode property: Reason for the specified billing profile status. - * - * @return the statusReasonCode value. - */ - public StatusReasonCode statusReasonCode() { - return this.statusReasonCode; - } - - /** - * Get the spendingLimit property: The billing profile spending limit. - * - * @return the spendingLimit value. - */ - public SpendingLimit spendingLimit() { - return this.spendingLimit; - } - - /** - * Get the targetClouds property: Identifies the cloud environments that are associated with a billing profile. This - * is a system managed optional field and gets updated as the billing profile gets associated with accounts in - * various clouds. - * - * @return the targetClouds value. - */ - public List targetClouds() { - return this.targetClouds; - } - - /** - * Get the tags property: Tags of billing profiles. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Tags of billing profiles. - * - * @param tags the tags value to set. - * @return the BillingProfileProperties object itself. - */ - public BillingProfileProperties withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (billTo() != null) { - billTo().validate(); - } - if (indirectRelationshipInfo() != null) { - indirectRelationshipInfo().validate(); - } - if (enabledAzurePlans() != null) { - enabledAzurePlans().forEach(e -> e.validate()); - } - if (invoiceSections() != null) { - invoiceSections().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyInner.java deleted file mode 100644 index 4f59a4ef0e36..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyInner.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.BillingProfileSpendingLimit; -import com.azure.resourcemanager.billing.models.BillingProfileStatus; -import com.azure.resourcemanager.billing.models.BillingProfileStatusReasonCode; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A billing property. */ -@Fluent -public final class BillingPropertyInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingPropertyInner.class); - - /* - * A billing property. - */ - @JsonProperty(value = "properties") - private BillingPropertyProperties innerProperties; - - /** - * Get the innerProperties property: A billing property. - * - * @return the innerProperties value. - */ - private BillingPropertyProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the accountAdminNotificationEmailAddress property: The email address on which the account admin gets all - * Azure notifications. - * - * @return the accountAdminNotificationEmailAddress value. - */ - public String accountAdminNotificationEmailAddress() { - return this.innerProperties() == null ? null : this.innerProperties().accountAdminNotificationEmailAddress(); - } - - /** - * Get the billingTenantId property: The Azure AD tenant ID of the billing account for the subscription. - * - * @return the billingTenantId value. - */ - public String billingTenantId() { - return this.innerProperties() == null ? null : this.innerProperties().billingTenantId(); - } - - /** - * Get the billingAccountId property: The ID of the billing account to which the subscription is billed. - * - * @return the billingAccountId value. - */ - public String billingAccountId() { - return this.innerProperties() == null ? null : this.innerProperties().billingAccountId(); - } - - /** - * Get the billingAccountDisplayName property: The name of the billing account to which the subscription is billed. - * - * @return the billingAccountDisplayName value. - */ - public String billingAccountDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingAccountDisplayName(); - } - - /** - * Get the billingProfileId property: The ID of the billing profile to which the subscription is billed. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); - } - - /** - * Get the billingProfileStatus property: The status of the billing profile. - * - * @return the billingProfileStatus value. - */ - public BillingProfileStatus billingProfileStatus() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileStatus(); - } - - /** - * Get the billingProfileStatusReasonCode property: Reason for the specified billing profile status. - * - * @return the billingProfileStatusReasonCode value. - */ - public BillingProfileStatusReasonCode billingProfileStatusReasonCode() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileStatusReasonCode(); - } - - /** - * Get the billingProfileSpendingLimit property: The billing profile spending limit. - * - * @return the billingProfileSpendingLimit value. - */ - public BillingProfileSpendingLimit billingProfileSpendingLimit() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileSpendingLimit(); - } - - /** - * Get the costCenter property: The cost center applied to the subscription. - * - * @return the costCenter value. - */ - public String costCenter() { - return this.innerProperties() == null ? null : this.innerProperties().costCenter(); - } - - /** - * Set the costCenter property: The cost center applied to the subscription. - * - * @param costCenter the costCenter value to set. - * @return the BillingPropertyInner object itself. - */ - public BillingPropertyInner withCostCenter(String costCenter) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingPropertyProperties(); - } - this.innerProperties().withCostCenter(costCenter); - return this; - } - - /** - * Get the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionId value. - */ - public String invoiceSectionId() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); - } - - /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionDisplayName value. - */ - public String invoiceSectionDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); - } - - /** - * Get the isAccountAdmin property: Indicates whether user is the account admin. - * - * @return the isAccountAdmin value. - */ - public Boolean isAccountAdmin() { - return this.innerProperties() == null ? null : this.innerProperties().isAccountAdmin(); - } - - /** - * Get the productId property: The product ID of the Azure plan. - * - * @return the productId value. - */ - public String productId() { - return this.innerProperties() == null ? null : this.innerProperties().productId(); - } - - /** - * Get the productName property: The product name of the Azure plan. - * - * @return the productName value. - */ - public String productName() { - return this.innerProperties() == null ? null : this.innerProperties().productName(); - } - - /** - * Get the skuId property: The sku ID of the Azure plan for the subscription. - * - * @return the skuId value. - */ - public String skuId() { - return this.innerProperties() == null ? null : this.innerProperties().skuId(); - } - - /** - * Get the skuDescription property: The sku description of the Azure plan for the subscription. - * - * @return the skuDescription value. - */ - public String skuDescription() { - return this.innerProperties() == null ? null : this.innerProperties().skuDescription(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyProperties.java deleted file mode 100644 index 28aaf5e0b5ca..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyProperties.java +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.BillingProfileSpendingLimit; -import com.azure.resourcemanager.billing.models.BillingProfileStatus; -import com.azure.resourcemanager.billing.models.BillingProfileStatusReasonCode; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The billing property. */ -@Fluent -public final class BillingPropertyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingPropertyProperties.class); - - /* - * The email address on which the account admin gets all Azure - * notifications. - */ - @JsonProperty(value = "accountAdminNotificationEmailAddress", access = JsonProperty.Access.WRITE_ONLY) - private String accountAdminNotificationEmailAddress; - - /* - * The Azure AD tenant ID of the billing account for the subscription. - */ - @JsonProperty(value = "billingTenantId", access = JsonProperty.Access.WRITE_ONLY) - private String billingTenantId; - - /* - * The ID of the billing account to which the subscription is billed. - */ - @JsonProperty(value = "billingAccountId", access = JsonProperty.Access.WRITE_ONLY) - private String billingAccountId; - - /* - * The name of the billing account to which the subscription is billed. - */ - @JsonProperty(value = "billingAccountDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingAccountDisplayName; - - /* - * The ID of the billing profile to which the subscription is billed. - */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * The name of the billing profile to which the subscription is billed. - */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; - - /* - * The status of the billing profile. - */ - @JsonProperty(value = "billingProfileStatus", access = JsonProperty.Access.WRITE_ONLY) - private BillingProfileStatus billingProfileStatus; - - /* - * Reason for the specified billing profile status. - */ - @JsonProperty(value = "billingProfileStatusReasonCode", access = JsonProperty.Access.WRITE_ONLY) - private BillingProfileStatusReasonCode billingProfileStatusReasonCode; - - /* - * The billing profile spending limit. - */ - @JsonProperty(value = "billingProfileSpendingLimit", access = JsonProperty.Access.WRITE_ONLY) - private BillingProfileSpendingLimit billingProfileSpendingLimit; - - /* - * The cost center applied to the subscription. - */ - @JsonProperty(value = "costCenter") - private String costCenter; - - /* - * The ID of the invoice section to which the subscription is billed. - */ - @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; - - /* - * The name of the invoice section to which the subscription is billed. - */ - @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionDisplayName; - - /* - * Indicates whether user is the account admin. - */ - @JsonProperty(value = "isAccountAdmin", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isAccountAdmin; - - /* - * The product ID of the Azure plan. - */ - @JsonProperty(value = "productId", access = JsonProperty.Access.WRITE_ONLY) - private String productId; - - /* - * The product name of the Azure plan. - */ - @JsonProperty(value = "productName", access = JsonProperty.Access.WRITE_ONLY) - private String productName; - - /* - * The sku ID of the Azure plan for the subscription. - */ - @JsonProperty(value = "skuId", access = JsonProperty.Access.WRITE_ONLY) - private String skuId; - - /* - * The sku description of the Azure plan for the subscription. - */ - @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) - private String skuDescription; - - /** - * Get the accountAdminNotificationEmailAddress property: The email address on which the account admin gets all - * Azure notifications. - * - * @return the accountAdminNotificationEmailAddress value. - */ - public String accountAdminNotificationEmailAddress() { - return this.accountAdminNotificationEmailAddress; - } - - /** - * Get the billingTenantId property: The Azure AD tenant ID of the billing account for the subscription. - * - * @return the billingTenantId value. - */ - public String billingTenantId() { - return this.billingTenantId; - } - - /** - * Get the billingAccountId property: The ID of the billing account to which the subscription is billed. - * - * @return the billingAccountId value. - */ - public String billingAccountId() { - return this.billingAccountId; - } - - /** - * Get the billingAccountDisplayName property: The name of the billing account to which the subscription is billed. - * - * @return the billingAccountDisplayName value. - */ - public String billingAccountDisplayName() { - return this.billingAccountDisplayName; - } - - /** - * Get the billingProfileId property: The ID of the billing profile to which the subscription is billed. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.billingProfileId; - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; - } - - /** - * Get the billingProfileStatus property: The status of the billing profile. - * - * @return the billingProfileStatus value. - */ - public BillingProfileStatus billingProfileStatus() { - return this.billingProfileStatus; - } - - /** - * Get the billingProfileStatusReasonCode property: Reason for the specified billing profile status. - * - * @return the billingProfileStatusReasonCode value. - */ - public BillingProfileStatusReasonCode billingProfileStatusReasonCode() { - return this.billingProfileStatusReasonCode; - } - - /** - * Get the billingProfileSpendingLimit property: The billing profile spending limit. - * - * @return the billingProfileSpendingLimit value. - */ - public BillingProfileSpendingLimit billingProfileSpendingLimit() { - return this.billingProfileSpendingLimit; - } - - /** - * Get the costCenter property: The cost center applied to the subscription. - * - * @return the costCenter value. - */ - public String costCenter() { - return this.costCenter; - } - - /** - * Set the costCenter property: The cost center applied to the subscription. - * - * @param costCenter the costCenter value to set. - * @return the BillingPropertyProperties object itself. - */ - public BillingPropertyProperties withCostCenter(String costCenter) { - this.costCenter = costCenter; - return this; - } - - /** - * Get the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionId value. - */ - public String invoiceSectionId() { - return this.invoiceSectionId; - } - - /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionDisplayName value. - */ - public String invoiceSectionDisplayName() { - return this.invoiceSectionDisplayName; - } - - /** - * Get the isAccountAdmin property: Indicates whether user is the account admin. - * - * @return the isAccountAdmin value. - */ - public Boolean isAccountAdmin() { - return this.isAccountAdmin; - } - - /** - * Get the productId property: The product ID of the Azure plan. - * - * @return the productId value. - */ - public String productId() { - return this.productId; - } - - /** - * Get the productName property: The product name of the Azure plan. - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Get the skuId property: The sku ID of the Azure plan for the subscription. - * - * @return the skuId value. - */ - public String skuId() { - return this.skuId; - } - - /** - * Get the skuDescription property: The sku description of the Azure plan for the subscription. - * - * @return the skuDescription value. - */ - public String skuDescription() { - return this.skuDescription; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentInner.java deleted file mode 100644 index e9a38b3242bb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentInner.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The role assignment. */ -@Fluent -public final class BillingRoleAssignmentInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingRoleAssignmentInner.class); - - /* - * The properties of the role assignment. - */ - @JsonProperty(value = "properties") - private BillingRoleAssignmentProperties innerProperties; - - /** - * Get the innerProperties property: The properties of the role assignment. - * - * @return the innerProperties value. - */ - private BillingRoleAssignmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the createdOn property: The date the role assignment was created. - * - * @return the createdOn value. - */ - public String createdOn() { - return this.innerProperties() == null ? null : this.innerProperties().createdOn(); - } - - /** - * Get the createdByPrincipalTenantId property: The tenant Id of the user who created the role assignment. - * - * @return the createdByPrincipalTenantId value. - */ - public String createdByPrincipalTenantId() { - return this.innerProperties() == null ? null : this.innerProperties().createdByPrincipalTenantId(); - } - - /** - * Get the createdByPrincipalId property: The principal Id of the user who created the role assignment. - * - * @return the createdByPrincipalId value. - */ - public String createdByPrincipalId() { - return this.innerProperties() == null ? null : this.innerProperties().createdByPrincipalId(); - } - - /** - * Get the createdByUserEmailAddress property: The email address of the user who created the role assignment. - * - * @return the createdByUserEmailAddress value. - */ - public String createdByUserEmailAddress() { - return this.innerProperties() == null ? null : this.innerProperties().createdByUserEmailAddress(); - } - - /** - * Get the principalId property: The principal id of the user to whom the role was assigned. - * - * @return the principalId value. - */ - public String principalId() { - return this.innerProperties() == null ? null : this.innerProperties().principalId(); - } - - /** - * Set the principalId property: The principal id of the user to whom the role was assigned. - * - * @param principalId the principalId value to set. - * @return the BillingRoleAssignmentInner object itself. - */ - public BillingRoleAssignmentInner withPrincipalId(String principalId) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingRoleAssignmentProperties(); - } - this.innerProperties().withPrincipalId(principalId); - return this; - } - - /** - * Get the principalTenantId property: The principal tenant id of the user to whom the role was assigned. - * - * @return the principalTenantId value. - */ - public String principalTenantId() { - return this.innerProperties() == null ? null : this.innerProperties().principalTenantId(); - } - - /** - * Set the principalTenantId property: The principal tenant id of the user to whom the role was assigned. - * - * @param principalTenantId the principalTenantId value to set. - * @return the BillingRoleAssignmentInner object itself. - */ - public BillingRoleAssignmentInner withPrincipalTenantId(String principalTenantId) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingRoleAssignmentProperties(); - } - this.innerProperties().withPrincipalTenantId(principalTenantId); - return this; - } - - /** - * Get the roleDefinitionId property: The ID of the role definition. - * - * @return the roleDefinitionId value. - */ - public String roleDefinitionId() { - return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); - } - - /** - * Set the roleDefinitionId property: The ID of the role definition. - * - * @param roleDefinitionId the roleDefinitionId value to set. - * @return the BillingRoleAssignmentInner object itself. - */ - public BillingRoleAssignmentInner withRoleDefinitionId(String roleDefinitionId) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingRoleAssignmentProperties(); - } - this.innerProperties().withRoleDefinitionId(roleDefinitionId); - return this; - } - - /** - * Get the scope property: The scope at which the role was assigned. - * - * @return the scope value. - */ - public String scope() { - return this.innerProperties() == null ? null : this.innerProperties().scope(); - } - - /** - * Get the userAuthenticationType property: The authentication type. - * - * @return the userAuthenticationType value. - */ - public String userAuthenticationType() { - return this.innerProperties() == null ? null : this.innerProperties().userAuthenticationType(); - } - - /** - * Set the userAuthenticationType property: The authentication type. - * - * @param userAuthenticationType the userAuthenticationType value to set. - * @return the BillingRoleAssignmentInner object itself. - */ - public BillingRoleAssignmentInner withUserAuthenticationType(String userAuthenticationType) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingRoleAssignmentProperties(); - } - this.innerProperties().withUserAuthenticationType(userAuthenticationType); - return this; - } - - /** - * Get the userEmailAddress property: The email address of the user. - * - * @return the userEmailAddress value. - */ - public String userEmailAddress() { - return this.innerProperties() == null ? null : this.innerProperties().userEmailAddress(); - } - - /** - * Set the userEmailAddress property: The email address of the user. - * - * @param userEmailAddress the userEmailAddress value to set. - * @return the BillingRoleAssignmentInner object itself. - */ - public BillingRoleAssignmentInner withUserEmailAddress(String userEmailAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingRoleAssignmentProperties(); - } - this.innerProperties().withUserEmailAddress(userEmailAddress); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentProperties.java deleted file mode 100644 index a7271bc64cb7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleAssignmentProperties.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of the role assignment. */ -@Fluent -public final class BillingRoleAssignmentProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingRoleAssignmentProperties.class); - - /* - * The date the role assignment was created. - */ - @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) - private String createdOn; - - /* - * The tenant Id of the user who created the role assignment. - */ - @JsonProperty(value = "createdByPrincipalTenantId", access = JsonProperty.Access.WRITE_ONLY) - private String createdByPrincipalTenantId; - - /* - * The principal Id of the user who created the role assignment. - */ - @JsonProperty(value = "createdByPrincipalId", access = JsonProperty.Access.WRITE_ONLY) - private String createdByPrincipalId; - - /* - * The email address of the user who created the role assignment. - */ - @JsonProperty(value = "createdByUserEmailAddress", access = JsonProperty.Access.WRITE_ONLY) - private String createdByUserEmailAddress; - - /* - * The principal id of the user to whom the role was assigned. - */ - @JsonProperty(value = "principalId") - private String principalId; - - /* - * The principal tenant id of the user to whom the role was assigned. - */ - @JsonProperty(value = "principalTenantId") - private String principalTenantId; - - /* - * The ID of the role definition. - */ - @JsonProperty(value = "roleDefinitionId") - private String roleDefinitionId; - - /* - * The scope at which the role was assigned. - */ - @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) - private String scope; - - /* - * The authentication type. - */ - @JsonProperty(value = "userAuthenticationType") - private String userAuthenticationType; - - /* - * The email address of the user. - */ - @JsonProperty(value = "userEmailAddress") - private String userEmailAddress; - - /** - * Get the createdOn property: The date the role assignment was created. - * - * @return the createdOn value. - */ - public String createdOn() { - return this.createdOn; - } - - /** - * Get the createdByPrincipalTenantId property: The tenant Id of the user who created the role assignment. - * - * @return the createdByPrincipalTenantId value. - */ - public String createdByPrincipalTenantId() { - return this.createdByPrincipalTenantId; - } - - /** - * Get the createdByPrincipalId property: The principal Id of the user who created the role assignment. - * - * @return the createdByPrincipalId value. - */ - public String createdByPrincipalId() { - return this.createdByPrincipalId; - } - - /** - * Get the createdByUserEmailAddress property: The email address of the user who created the role assignment. - * - * @return the createdByUserEmailAddress value. - */ - public String createdByUserEmailAddress() { - return this.createdByUserEmailAddress; - } - - /** - * Get the principalId property: The principal id of the user to whom the role was assigned. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: The principal id of the user to whom the role was assigned. - * - * @param principalId the principalId value to set. - * @return the BillingRoleAssignmentProperties object itself. - */ - public BillingRoleAssignmentProperties withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * Get the principalTenantId property: The principal tenant id of the user to whom the role was assigned. - * - * @return the principalTenantId value. - */ - public String principalTenantId() { - return this.principalTenantId; - } - - /** - * Set the principalTenantId property: The principal tenant id of the user to whom the role was assigned. - * - * @param principalTenantId the principalTenantId value to set. - * @return the BillingRoleAssignmentProperties object itself. - */ - public BillingRoleAssignmentProperties withPrincipalTenantId(String principalTenantId) { - this.principalTenantId = principalTenantId; - return this; - } - - /** - * Get the roleDefinitionId property: The ID of the role definition. - * - * @return the roleDefinitionId value. - */ - public String roleDefinitionId() { - return this.roleDefinitionId; - } - - /** - * Set the roleDefinitionId property: The ID of the role definition. - * - * @param roleDefinitionId the roleDefinitionId value to set. - * @return the BillingRoleAssignmentProperties object itself. - */ - public BillingRoleAssignmentProperties withRoleDefinitionId(String roleDefinitionId) { - this.roleDefinitionId = roleDefinitionId; - return this; - } - - /** - * Get the scope property: The scope at which the role was assigned. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Get the userAuthenticationType property: The authentication type. - * - * @return the userAuthenticationType value. - */ - public String userAuthenticationType() { - return this.userAuthenticationType; - } - - /** - * Set the userAuthenticationType property: The authentication type. - * - * @param userAuthenticationType the userAuthenticationType value to set. - * @return the BillingRoleAssignmentProperties object itself. - */ - public BillingRoleAssignmentProperties withUserAuthenticationType(String userAuthenticationType) { - this.userAuthenticationType = userAuthenticationType; - return this; - } - - /** - * Get the userEmailAddress property: The email address of the user. - * - * @return the userEmailAddress value. - */ - public String userEmailAddress() { - return this.userEmailAddress; - } - - /** - * Set the userEmailAddress property: The email address of the user. - * - * @param userEmailAddress the userEmailAddress value to set. - * @return the BillingRoleAssignmentProperties object itself. - */ - public BillingRoleAssignmentProperties withUserEmailAddress(String userEmailAddress) { - this.userEmailAddress = userEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleDefinitionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleDefinitionInner.java deleted file mode 100644 index cee0987629b9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleDefinitionInner.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of a role definition. */ -@Fluent -public final class BillingRoleDefinitionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingRoleDefinitionInner.class); - - /* - * The properties of the a role definition. - */ - @JsonProperty(value = "properties") - private BillingRoleDefinitionProperties innerProperties; - - /** - * Get the innerProperties property: The properties of the a role definition. - * - * @return the innerProperties value. - */ - private BillingRoleDefinitionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the description property: The role description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the permissions property: The billingPermissions the role has. - * - * @return the permissions value. - */ - public List permissions() { - return this.innerProperties() == null ? null : this.innerProperties().permissions(); - } - - /** - * Set the permissions property: The billingPermissions the role has. - * - * @param permissions the permissions value to set. - * @return the BillingRoleDefinitionInner object itself. - */ - public BillingRoleDefinitionInner withPermissions(List permissions) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingRoleDefinitionProperties(); - } - this.innerProperties().withPermissions(permissions); - return this; - } - - /** - * Get the roleName property: The name of the role. - * - * @return the roleName value. - */ - public String roleName() { - return this.innerProperties() == null ? null : this.innerProperties().roleName(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleDefinitionProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleDefinitionProperties.java deleted file mode 100644 index 4779fb34d81a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingRoleDefinitionProperties.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of the a role definition. */ -@Fluent -public final class BillingRoleDefinitionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingRoleDefinitionProperties.class); - - /* - * The role description - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The billingPermissions the role has - */ - @JsonProperty(value = "permissions") - private List permissions; - - /* - * The name of the role - */ - @JsonProperty(value = "roleName", access = JsonProperty.Access.WRITE_ONLY) - private String roleName; - - /** - * Get the description property: The role description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the permissions property: The billingPermissions the role has. - * - * @return the permissions value. - */ - public List permissions() { - return this.permissions; - } - - /** - * Set the permissions property: The billingPermissions the role has. - * - * @param permissions the permissions value to set. - * @return the BillingRoleDefinitionProperties object itself. - */ - public BillingRoleDefinitionProperties withPermissions(List permissions) { - this.permissions = permissions; - return this; - } - - /** - * Get the roleName property: The name of the role. - * - * @return the roleName value. - */ - public String roleName() { - return this.roleName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (permissions() != null) { - permissions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionInner.java deleted file mode 100644 index df2b910364f4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionInner.java +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import com.azure.resourcemanager.billing.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.UUID; - -/** A billing subscription. */ -@Fluent -public final class BillingSubscriptionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingSubscriptionInner.class); - - /* - * The billing properties of a subscription. - */ - @JsonProperty(value = "properties") - private BillingSubscriptionProperties innerProperties; - - /** - * Get the innerProperties property: The billing properties of a subscription. - * - * @return the innerProperties value. - */ - private BillingSubscriptionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: The name of the subscription. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the subscriptionId property: The ID of the subscription. - * - * @return the subscriptionId value. - */ - public UUID subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); - } - - /** - * Get the subscriptionBillingStatus property: The current billing status of the subscription. - * - * @return the subscriptionBillingStatus value. - */ - public BillingSubscriptionStatusType subscriptionBillingStatus() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionBillingStatus(); - } - - /** - * Set the subscriptionBillingStatus property: The current billing status of the subscription. - * - * @param subscriptionBillingStatus the subscriptionBillingStatus value to set. - * @return the BillingSubscriptionInner object itself. - */ - public BillingSubscriptionInner withSubscriptionBillingStatus( - BillingSubscriptionStatusType subscriptionBillingStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingSubscriptionProperties(); - } - this.innerProperties().withSubscriptionBillingStatus(subscriptionBillingStatus); - return this; - } - - /** - * Get the lastMonthCharges property: The last month charges. - * - * @return the lastMonthCharges value. - */ - public Amount lastMonthCharges() { - return this.innerProperties() == null ? null : this.innerProperties().lastMonthCharges(); - } - - /** - * Get the monthToDateCharges property: The current month to date charges. - * - * @return the monthToDateCharges value. - */ - public Amount monthToDateCharges() { - return this.innerProperties() == null ? null : this.innerProperties().monthToDateCharges(); - } - - /** - * Get the billingProfileId property: The ID of the billing profile to which the subscription is billed. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); - } - - /** - * Get the costCenter property: The cost center applied to the subscription. - * - * @return the costCenter value. - */ - public String costCenter() { - return this.innerProperties() == null ? null : this.innerProperties().costCenter(); - } - - /** - * Set the costCenter property: The cost center applied to the subscription. - * - * @param costCenter the costCenter value to set. - * @return the BillingSubscriptionInner object itself. - */ - public BillingSubscriptionInner withCostCenter(String costCenter) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingSubscriptionProperties(); - } - this.innerProperties().withCostCenter(costCenter); - return this; - } - - /** - * Get the customerId property: The ID of the customer for whom the subscription was created. The field is - * applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerId value. - */ - public String customerId() { - return this.innerProperties() == null ? null : this.innerProperties().customerId(); - } - - /** - * Get the customerDisplayName property: The name of the customer for whom the subscription was created. The field - * is applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerDisplayName value. - */ - public String customerDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().customerDisplayName(); - } - - /** - * Get the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionId value. - */ - public String invoiceSectionId() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); - } - - /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionDisplayName value. - */ - public String invoiceSectionDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); - } - - /** - * Get the reseller property: Reseller for this subscription. - * - * @return the reseller value. - */ - public Reseller reseller() { - return this.innerProperties() == null ? null : this.innerProperties().reseller(); - } - - /** - * Get the skuId property: The sku ID of the Azure plan for the subscription. - * - * @return the skuId value. - */ - public String skuId() { - return this.innerProperties() == null ? null : this.innerProperties().skuId(); - } - - /** - * Set the skuId property: The sku ID of the Azure plan for the subscription. - * - * @param skuId the skuId value to set. - * @return the BillingSubscriptionInner object itself. - */ - public BillingSubscriptionInner withSkuId(String skuId) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingSubscriptionProperties(); - } - this.innerProperties().withSkuId(skuId); - return this; - } - - /** - * Get the skuDescription property: The sku description of the Azure plan for the subscription. - * - * @return the skuDescription value. - */ - public String skuDescription() { - return this.innerProperties() == null ? null : this.innerProperties().skuDescription(); - } - - /** - * Get the suspensionReasons property: The suspension reason for a subscription. Applies only to subscriptions in - * Microsoft Online Services Program billing accounts. - * - * @return the suspensionReasons value. - */ - public List suspensionReasons() { - return this.innerProperties() == null ? null : this.innerProperties().suspensionReasons(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionProperties.java deleted file mode 100644 index b32b5b069e38..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionProperties.java +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import com.azure.resourcemanager.billing.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.UUID; - -/** The billing properties of a subscription. */ -@Fluent -public final class BillingSubscriptionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingSubscriptionProperties.class); - - /* - * The name of the subscription. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * The ID of the subscription. - */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private UUID subscriptionId; - - /* - * The current billing status of the subscription. - */ - @JsonProperty(value = "subscriptionBillingStatus") - private BillingSubscriptionStatusType subscriptionBillingStatus; - - /* - * The last month charges. - */ - @JsonProperty(value = "lastMonthCharges", access = JsonProperty.Access.WRITE_ONLY) - private Amount lastMonthCharges; - - /* - * The current month to date charges. - */ - @JsonProperty(value = "monthToDateCharges", access = JsonProperty.Access.WRITE_ONLY) - private Amount monthToDateCharges; - - /* - * The ID of the billing profile to which the subscription is billed. - */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * The name of the billing profile to which the subscription is billed. - */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; - - /* - * The cost center applied to the subscription. - */ - @JsonProperty(value = "costCenter") - private String costCenter; - - /* - * The ID of the customer for whom the subscription was created. The field - * is applicable only for Microsoft Partner Agreement billing account. - */ - @JsonProperty(value = "customerId", access = JsonProperty.Access.WRITE_ONLY) - private String customerId; - - /* - * The name of the customer for whom the subscription was created. The - * field is applicable only for Microsoft Partner Agreement billing - * account. - */ - @JsonProperty(value = "customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String customerDisplayName; - - /* - * The ID of the invoice section to which the subscription is billed. - */ - @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; - - /* - * The name of the invoice section to which the subscription is billed. - */ - @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionDisplayName; - - /* - * Reseller for this subscription. - */ - @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY) - private Reseller reseller; - - /* - * The sku ID of the Azure plan for the subscription. - */ - @JsonProperty(value = "skuId") - private String skuId; - - /* - * The sku description of the Azure plan for the subscription. - */ - @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) - private String skuDescription; - - /* - * The suspension reason for a subscription. Applies only to subscriptions - * in Microsoft Online Services Program billing accounts. - */ - @JsonProperty(value = "suspensionReasons", access = JsonProperty.Access.WRITE_ONLY) - private List suspensionReasons; - - /** - * Get the displayName property: The name of the subscription. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the subscriptionId property: The ID of the subscription. - * - * @return the subscriptionId value. - */ - public UUID subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the subscriptionBillingStatus property: The current billing status of the subscription. - * - * @return the subscriptionBillingStatus value. - */ - public BillingSubscriptionStatusType subscriptionBillingStatus() { - return this.subscriptionBillingStatus; - } - - /** - * Set the subscriptionBillingStatus property: The current billing status of the subscription. - * - * @param subscriptionBillingStatus the subscriptionBillingStatus value to set. - * @return the BillingSubscriptionProperties object itself. - */ - public BillingSubscriptionProperties withSubscriptionBillingStatus( - BillingSubscriptionStatusType subscriptionBillingStatus) { - this.subscriptionBillingStatus = subscriptionBillingStatus; - return this; - } - - /** - * Get the lastMonthCharges property: The last month charges. - * - * @return the lastMonthCharges value. - */ - public Amount lastMonthCharges() { - return this.lastMonthCharges; - } - - /** - * Get the monthToDateCharges property: The current month to date charges. - * - * @return the monthToDateCharges value. - */ - public Amount monthToDateCharges() { - return this.monthToDateCharges; - } - - /** - * Get the billingProfileId property: The ID of the billing profile to which the subscription is billed. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.billingProfileId; - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; - } - - /** - * Get the costCenter property: The cost center applied to the subscription. - * - * @return the costCenter value. - */ - public String costCenter() { - return this.costCenter; - } - - /** - * Set the costCenter property: The cost center applied to the subscription. - * - * @param costCenter the costCenter value to set. - * @return the BillingSubscriptionProperties object itself. - */ - public BillingSubscriptionProperties withCostCenter(String costCenter) { - this.costCenter = costCenter; - return this; - } - - /** - * Get the customerId property: The ID of the customer for whom the subscription was created. The field is - * applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerId value. - */ - public String customerId() { - return this.customerId; - } - - /** - * Get the customerDisplayName property: The name of the customer for whom the subscription was created. The field - * is applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerDisplayName value. - */ - public String customerDisplayName() { - return this.customerDisplayName; - } - - /** - * Get the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionId value. - */ - public String invoiceSectionId() { - return this.invoiceSectionId; - } - - /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionDisplayName value. - */ - public String invoiceSectionDisplayName() { - return this.invoiceSectionDisplayName; - } - - /** - * Get the reseller property: Reseller for this subscription. - * - * @return the reseller value. - */ - public Reseller reseller() { - return this.reseller; - } - - /** - * Get the skuId property: The sku ID of the Azure plan for the subscription. - * - * @return the skuId value. - */ - public String skuId() { - return this.skuId; - } - - /** - * Set the skuId property: The sku ID of the Azure plan for the subscription. - * - * @param skuId the skuId value to set. - * @return the BillingSubscriptionProperties object itself. - */ - public BillingSubscriptionProperties withSkuId(String skuId) { - this.skuId = skuId; - return this; - } - - /** - * Get the skuDescription property: The sku description of the Azure plan for the subscription. - * - * @return the skuDescription value. - */ - public String skuDescription() { - return this.skuDescription; - } - - /** - * Get the suspensionReasons property: The suspension reason for a subscription. Applies only to subscriptions in - * Microsoft Online Services Program billing accounts. - * - * @return the suspensionReasons value. - */ - public List suspensionReasons() { - return this.suspensionReasons; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (lastMonthCharges() != null) { - lastMonthCharges().validate(); - } - if (monthToDateCharges() != null) { - monthToDateCharges().validate(); - } - if (reseller() != null) { - reseller().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerInner.java deleted file mode 100644 index 9723f24be86a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerInner.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A partner's customer. */ -@Fluent -public final class CustomerInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerInner.class); - - /* - * The customer. - */ - @JsonProperty(value = "properties") - private CustomerProperties innerProperties; - - /** - * Get the innerProperties property: The customer. - * - * @return the innerProperties value. - */ - private CustomerProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the billingProfileId property: The ID of the billing profile for the invoice section. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); - } - - /** - * Get the displayName property: The name of the customer. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The name of the customer. - * - * @param displayName the displayName value to set. - * @return the CustomerInner object itself. - */ - public CustomerInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomerProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the enabledAzurePlans property: Azure plans enabled for the customer. - * - * @return the enabledAzurePlans value. - */ - public List enabledAzurePlans() { - return this.innerProperties() == null ? null : this.innerProperties().enabledAzurePlans(); - } - - /** - * Set the enabledAzurePlans property: Azure plans enabled for the customer. - * - * @param enabledAzurePlans the enabledAzurePlans value to set. - * @return the CustomerInner object itself. - */ - public CustomerInner withEnabledAzurePlans(List enabledAzurePlans) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomerProperties(); - } - this.innerProperties().withEnabledAzurePlans(enabledAzurePlans); - return this; - } - - /** - * Get the resellers property: The list of resellers for which an Azure plan is enabled for the customer. - * - * @return the resellers value. - */ - public List resellers() { - return this.innerProperties() == null ? null : this.innerProperties().resellers(); - } - - /** - * Set the resellers property: The list of resellers for which an Azure plan is enabled for the customer. - * - * @param resellers the resellers value to set. - * @return the CustomerInner object itself. - */ - public CustomerInner withResellers(List resellers) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomerProperties(); - } - this.innerProperties().withResellers(resellers); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyInner.java deleted file mode 100644 index 42d39870014f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyInner.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.ViewCharges; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The customer's Policy. */ -@Fluent -public final class CustomerPolicyInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerPolicyInner.class); - - /* - * The properties of a customer's policy. - */ - @JsonProperty(value = "properties") - private CustomerPolicyProperties innerProperties; - - /** - * Get the innerProperties property: The properties of a customer's policy. - * - * @return the innerProperties value. - */ - private CustomerPolicyProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the viewCharges property: The policy that controls whether the users in customer's organization can view - * charges at pay-as-you-go prices. - * - * @return the viewCharges value. - */ - public ViewCharges viewCharges() { - return this.innerProperties() == null ? null : this.innerProperties().viewCharges(); - } - - /** - * Set the viewCharges property: The policy that controls whether the users in customer's organization can view - * charges at pay-as-you-go prices. - * - * @param viewCharges the viewCharges value to set. - * @return the CustomerPolicyInner object itself. - */ - public CustomerPolicyInner withViewCharges(ViewCharges viewCharges) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomerPolicyProperties(); - } - this.innerProperties().withViewCharges(viewCharges); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyProperties.java deleted file mode 100644 index 1cf4dc9c1feb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.ViewCharges; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a customer's policy. */ -@Fluent -public final class CustomerPolicyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerPolicyProperties.class); - - /* - * The policy that controls whether the users in customer's organization - * can view charges at pay-as-you-go prices. - */ - @JsonProperty(value = "viewCharges") - private ViewCharges viewCharges; - - /** - * Get the viewCharges property: The policy that controls whether the users in customer's organization can view - * charges at pay-as-you-go prices. - * - * @return the viewCharges value. - */ - public ViewCharges viewCharges() { - return this.viewCharges; - } - - /** - * Set the viewCharges property: The policy that controls whether the users in customer's organization can view - * charges at pay-as-you-go prices. - * - * @param viewCharges the viewCharges value to set. - * @return the CustomerPolicyProperties object itself. - */ - public CustomerPolicyProperties withViewCharges(ViewCharges viewCharges) { - this.viewCharges = viewCharges; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerProperties.java deleted file mode 100644 index b3104bb02aaa..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerProperties.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of a customer. */ -@Fluent -public final class CustomerProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerProperties.class); - - /* - * The ID of the billing profile for the invoice section. - */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * The name of the billing profile for the invoice section. - */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; - - /* - * The name of the customer. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Azure plans enabled for the customer. - */ - @JsonProperty(value = "enabledAzurePlans") - private List enabledAzurePlans; - - /* - * The list of resellers for which an Azure plan is enabled for the - * customer. - */ - @JsonProperty(value = "resellers") - private List resellers; - - /** - * Get the billingProfileId property: The ID of the billing profile for the invoice section. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.billingProfileId; - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; - } - - /** - * Get the displayName property: The name of the customer. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The name of the customer. - * - * @param displayName the displayName value to set. - * @return the CustomerProperties object itself. - */ - public CustomerProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the enabledAzurePlans property: Azure plans enabled for the customer. - * - * @return the enabledAzurePlans value. - */ - public List enabledAzurePlans() { - return this.enabledAzurePlans; - } - - /** - * Set the enabledAzurePlans property: Azure plans enabled for the customer. - * - * @param enabledAzurePlans the enabledAzurePlans value to set. - * @return the CustomerProperties object itself. - */ - public CustomerProperties withEnabledAzurePlans(List enabledAzurePlans) { - this.enabledAzurePlans = enabledAzurePlans; - return this; - } - - /** - * Get the resellers property: The list of resellers for which an Azure plan is enabled for the customer. - * - * @return the resellers value. - */ - public List resellers() { - return this.resellers; - } - - /** - * Set the resellers property: The list of resellers for which an Azure plan is enabled for the customer. - * - * @param resellers the resellers value to set. - * @return the CustomerProperties object itself. - */ - public CustomerProperties withResellers(List resellers) { - this.resellers = resellers; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (enabledAzurePlans() != null) { - enabledAzurePlans().forEach(e -> e.validate()); - } - if (resellers() != null) { - resellers().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DepartmentProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DepartmentProperties.java deleted file mode 100644 index b8faa43a8dd7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DepartmentProperties.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of a department. */ -@Fluent -public final class DepartmentProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DepartmentProperties.class); - - /* - * The name of the department. - */ - @JsonProperty(value = "departmentName") - private String departmentName; - - /* - * The cost center associated with the department. - */ - @JsonProperty(value = "costCenter") - private String costCenter; - - /* - * The status of the department. - */ - @JsonProperty(value = "status") - private String status; - - /* - * Associated enrollment accounts. By default this is not populated, unless - * it's specified in $expand. - */ - @JsonProperty(value = "enrollmentAccounts") - private List enrollmentAccounts; - - /** - * Get the departmentName property: The name of the department. - * - * @return the departmentName value. - */ - public String departmentName() { - return this.departmentName; - } - - /** - * Set the departmentName property: The name of the department. - * - * @param departmentName the departmentName value to set. - * @return the DepartmentProperties object itself. - */ - public DepartmentProperties withDepartmentName(String departmentName) { - this.departmentName = departmentName; - return this; - } - - /** - * Get the costCenter property: The cost center associated with the department. - * - * @return the costCenter value. - */ - public String costCenter() { - return this.costCenter; - } - - /** - * Set the costCenter property: The cost center associated with the department. - * - * @param costCenter the costCenter value to set. - * @return the DepartmentProperties object itself. - */ - public DepartmentProperties withCostCenter(String costCenter) { - this.costCenter = costCenter; - return this; - } - - /** - * Get the status property: The status of the department. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: The status of the department. - * - * @param status the status value to set. - * @return the DepartmentProperties object itself. - */ - public DepartmentProperties withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the enrollmentAccounts property: Associated enrollment accounts. By default this is not populated, unless - * it's specified in $expand. - * - * @return the enrollmentAccounts value. - */ - public List enrollmentAccounts() { - return this.enrollmentAccounts; - } - - /** - * Set the enrollmentAccounts property: Associated enrollment accounts. By default this is not populated, unless - * it's specified in $expand. - * - * @param enrollmentAccounts the enrollmentAccounts value to set. - * @return the DepartmentProperties object itself. - */ - public DepartmentProperties withEnrollmentAccounts(List enrollmentAccounts) { - this.enrollmentAccounts = enrollmentAccounts; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (enrollmentAccounts() != null) { - enrollmentAccounts().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DownloadUrlInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DownloadUrlInner.java deleted file mode 100644 index f8b4bc915aad..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DownloadUrlInner.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A secure URL that can be used to download a an entity until the URL expires. */ -@Immutable -public final class DownloadUrlInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DownloadUrlInner.class); - - /* - * The time in UTC when the download URL will expire. - */ - @JsonProperty(value = "expiryTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expiryTime; - - /* - * The URL to the PDF file. - */ - @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) - private String url; - - /** - * Get the expiryTime property: The time in UTC when the download URL will expire. - * - * @return the expiryTime value. - */ - public OffsetDateTime expiryTime() { - return this.expiryTime; - } - - /** - * Get the url property: The URL to the PDF file. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountProperties.java deleted file mode 100644 index 657f137f55c9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountProperties.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Department; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of an enrollment account. */ -@Fluent -public final class EnrollmentAccountProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrollmentAccountProperties.class); - - /* - * The name of the enrollment account. - */ - @JsonProperty(value = "accountName") - private String accountName; - - /* - * The cost center associated with the enrollment account. - */ - @JsonProperty(value = "costCenter") - private String costCenter; - - /* - * The owner of the enrollment account. - */ - @JsonProperty(value = "accountOwner") - private String accountOwner; - - /* - * The enrollment account owner email address. - */ - @JsonProperty(value = "accountOwnerEmail") - private String accountOwnerEmail; - - /* - * The status of the enrollment account. - */ - @JsonProperty(value = "status") - private String status; - - /* - * The start date of the enrollment account. - */ - @JsonProperty(value = "startDate") - private OffsetDateTime startDate; - - /* - * The end date of the enrollment account. - */ - @JsonProperty(value = "endDate") - private OffsetDateTime endDate; - - /* - * Associated department. By default this is not populated, unless it's - * specified in $expand. - */ - @JsonProperty(value = "department") - private Department department; - - /** - * Get the accountName property: The name of the enrollment account. - * - * @return the accountName value. - */ - public String accountName() { - return this.accountName; - } - - /** - * Set the accountName property: The name of the enrollment account. - * - * @param accountName the accountName value to set. - * @return the EnrollmentAccountProperties object itself. - */ - public EnrollmentAccountProperties withAccountName(String accountName) { - this.accountName = accountName; - return this; - } - - /** - * Get the costCenter property: The cost center associated with the enrollment account. - * - * @return the costCenter value. - */ - public String costCenter() { - return this.costCenter; - } - - /** - * Set the costCenter property: The cost center associated with the enrollment account. - * - * @param costCenter the costCenter value to set. - * @return the EnrollmentAccountProperties object itself. - */ - public EnrollmentAccountProperties withCostCenter(String costCenter) { - this.costCenter = costCenter; - return this; - } - - /** - * Get the accountOwner property: The owner of the enrollment account. - * - * @return the accountOwner value. - */ - public String accountOwner() { - return this.accountOwner; - } - - /** - * Set the accountOwner property: The owner of the enrollment account. - * - * @param accountOwner the accountOwner value to set. - * @return the EnrollmentAccountProperties object itself. - */ - public EnrollmentAccountProperties withAccountOwner(String accountOwner) { - this.accountOwner = accountOwner; - return this; - } - - /** - * Get the accountOwnerEmail property: The enrollment account owner email address. - * - * @return the accountOwnerEmail value. - */ - public String accountOwnerEmail() { - return this.accountOwnerEmail; - } - - /** - * Set the accountOwnerEmail property: The enrollment account owner email address. - * - * @param accountOwnerEmail the accountOwnerEmail value to set. - * @return the EnrollmentAccountProperties object itself. - */ - public EnrollmentAccountProperties withAccountOwnerEmail(String accountOwnerEmail) { - this.accountOwnerEmail = accountOwnerEmail; - return this; - } - - /** - * Get the status property: The status of the enrollment account. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: The status of the enrollment account. - * - * @param status the status value to set. - * @return the EnrollmentAccountProperties object itself. - */ - public EnrollmentAccountProperties withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the startDate property: The start date of the enrollment account. - * - * @return the startDate value. - */ - public OffsetDateTime startDate() { - return this.startDate; - } - - /** - * Set the startDate property: The start date of the enrollment account. - * - * @param startDate the startDate value to set. - * @return the EnrollmentAccountProperties object itself. - */ - public EnrollmentAccountProperties withStartDate(OffsetDateTime startDate) { - this.startDate = startDate; - return this; - } - - /** - * Get the endDate property: The end date of the enrollment account. - * - * @return the endDate value. - */ - public OffsetDateTime endDate() { - return this.endDate; - } - - /** - * Set the endDate property: The end date of the enrollment account. - * - * @param endDate the endDate value to set. - * @return the EnrollmentAccountProperties object itself. - */ - public EnrollmentAccountProperties withEndDate(OffsetDateTime endDate) { - this.endDate = endDate; - return this; - } - - /** - * Get the department property: Associated department. By default this is not populated, unless it's specified in - * $expand. - * - * @return the department value. - */ - public Department department() { - return this.department; - } - - /** - * Set the department property: Associated department. By default this is not populated, unless it's specified in - * $expand. - * - * @param department the department value to set. - * @return the EnrollmentAccountProperties object itself. - */ - public EnrollmentAccountProperties withDepartment(Department department) { - this.department = department; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (department() != null) { - department().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryInner.java deleted file mode 100644 index 8d9822e0512c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryInner.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An enrollment account resource. */ -@Fluent -public final class EnrollmentAccountSummaryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrollmentAccountSummaryInner.class); - - /* - * An enrollment account. - */ - @JsonProperty(value = "properties") - private EnrollmentAccountSummaryProperties innerProperties; - - /** - * Get the innerProperties property: An enrollment account. - * - * @return the innerProperties value. - */ - private EnrollmentAccountSummaryProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the principalName property: The account owner's principal name. - * - * @return the principalName value. - */ - public String principalName() { - return this.innerProperties() == null ? null : this.innerProperties().principalName(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryProperties.java deleted file mode 100644 index 7b0d9943f82f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountSummaryProperties.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of the enrollment account. */ -@Immutable -public final class EnrollmentAccountSummaryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrollmentAccountSummaryProperties.class); - - /* - * The account owner's principal name. - */ - @JsonProperty(value = "principalName", access = JsonProperty.Access.WRITE_ONLY) - private String principalName; - - /** - * Get the principalName property: The account owner's principal name. - * - * @return the principalName value. - */ - public String principalName() { - return this.principalName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionInner.java deleted file mode 100644 index 84cd5142be08..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionInner.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** An instruction. */ -@Fluent -public final class InstructionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InstructionInner.class); - - /* - * A billing instruction used during invoice generation. - */ - @JsonProperty(value = "properties") - private InstructionProperties innerProperties; - - /** - * Get the innerProperties property: A billing instruction used during invoice generation. - * - * @return the innerProperties value. - */ - private InstructionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the amount property: The amount budgeted for this billing instruction. - * - * @return the amount value. - */ - public Float amount() { - return this.innerProperties() == null ? null : this.innerProperties().amount(); - } - - /** - * Set the amount property: The amount budgeted for this billing instruction. - * - * @param amount the amount value to set. - * @return the InstructionInner object itself. - */ - public InstructionInner withAmount(Float amount) { - if (this.innerProperties() == null) { - this.innerProperties = new InstructionProperties(); - } - this.innerProperties().withAmount(amount); - return this; - } - - /** - * Get the startDate property: The date this billing instruction goes into effect. - * - * @return the startDate value. - */ - public OffsetDateTime startDate() { - return this.innerProperties() == null ? null : this.innerProperties().startDate(); - } - - /** - * Set the startDate property: The date this billing instruction goes into effect. - * - * @param startDate the startDate value to set. - * @return the InstructionInner object itself. - */ - public InstructionInner withStartDate(OffsetDateTime startDate) { - if (this.innerProperties() == null) { - this.innerProperties = new InstructionProperties(); - } - this.innerProperties().withStartDate(startDate); - return this; - } - - /** - * Get the endDate property: The date this billing instruction is no longer in effect. - * - * @return the endDate value. - */ - public OffsetDateTime endDate() { - return this.innerProperties() == null ? null : this.innerProperties().endDate(); - } - - /** - * Set the endDate property: The date this billing instruction is no longer in effect. - * - * @param endDate the endDate value to set. - * @return the InstructionInner object itself. - */ - public InstructionInner withEndDate(OffsetDateTime endDate) { - if (this.innerProperties() == null) { - this.innerProperties = new InstructionProperties(); - } - this.innerProperties().withEndDate(endDate); - return this; - } - - /** - * Get the creationDate property: The date this billing instruction was created. - * - * @return the creationDate value. - */ - public OffsetDateTime creationDate() { - return this.innerProperties() == null ? null : this.innerProperties().creationDate(); - } - - /** - * Set the creationDate property: The date this billing instruction was created. - * - * @param creationDate the creationDate value to set. - * @return the InstructionInner object itself. - */ - public InstructionInner withCreationDate(OffsetDateTime creationDate) { - if (this.innerProperties() == null) { - this.innerProperties = new InstructionProperties(); - } - this.innerProperties().withCreationDate(creationDate); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionProperties.java deleted file mode 100644 index 9bd37586b391..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionProperties.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A billing instruction used during invoice generation. */ -@Fluent -public final class InstructionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InstructionProperties.class); - - /* - * The amount budgeted for this billing instruction. - */ - @JsonProperty(value = "amount", required = true) - private float amount; - - /* - * The date this billing instruction goes into effect. - */ - @JsonProperty(value = "startDate", required = true) - private OffsetDateTime startDate; - - /* - * The date this billing instruction is no longer in effect. - */ - @JsonProperty(value = "endDate", required = true) - private OffsetDateTime endDate; - - /* - * The date this billing instruction was created. - */ - @JsonProperty(value = "creationDate") - private OffsetDateTime creationDate; - - /** - * Get the amount property: The amount budgeted for this billing instruction. - * - * @return the amount value. - */ - public float amount() { - return this.amount; - } - - /** - * Set the amount property: The amount budgeted for this billing instruction. - * - * @param amount the amount value to set. - * @return the InstructionProperties object itself. - */ - public InstructionProperties withAmount(float amount) { - this.amount = amount; - return this; - } - - /** - * Get the startDate property: The date this billing instruction goes into effect. - * - * @return the startDate value. - */ - public OffsetDateTime startDate() { - return this.startDate; - } - - /** - * Set the startDate property: The date this billing instruction goes into effect. - * - * @param startDate the startDate value to set. - * @return the InstructionProperties object itself. - */ - public InstructionProperties withStartDate(OffsetDateTime startDate) { - this.startDate = startDate; - return this; - } - - /** - * Get the endDate property: The date this billing instruction is no longer in effect. - * - * @return the endDate value. - */ - public OffsetDateTime endDate() { - return this.endDate; - } - - /** - * Set the endDate property: The date this billing instruction is no longer in effect. - * - * @param endDate the endDate value to set. - * @return the InstructionProperties object itself. - */ - public InstructionProperties withEndDate(OffsetDateTime endDate) { - this.endDate = endDate; - return this; - } - - /** - * Get the creationDate property: The date this billing instruction was created. - * - * @return the creationDate value. - */ - public OffsetDateTime creationDate() { - return this.creationDate; - } - - /** - * Set the creationDate property: The date this billing instruction was created. - * - * @param creationDate the creationDate value to set. - * @return the InstructionProperties object itself. - */ - public InstructionProperties withCreationDate(OffsetDateTime creationDate) { - this.creationDate = creationDate; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (startDate() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property startDate in model InstructionProperties")); - } - if (endDate() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property endDate in model InstructionProperties")); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceInner.java deleted file mode 100644 index b951670e7825..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceInner.java +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.Document; -import com.azure.resourcemanager.billing.models.InvoiceDocumentType; -import com.azure.resourcemanager.billing.models.InvoiceStatus; -import com.azure.resourcemanager.billing.models.InvoiceType; -import com.azure.resourcemanager.billing.models.PaymentProperties; -import com.azure.resourcemanager.billing.models.RebillDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** An invoice. */ -@Fluent -public final class InvoiceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoiceInner.class); - - /* - * An invoice. - */ - @JsonProperty(value = "properties") - private InvoiceProperties innerProperties; - - /** - * Get the innerProperties property: An invoice. - * - * @return the innerProperties value. - */ - private InvoiceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the dueDate property: The due date for the invoice. - * - * @return the dueDate value. - */ - public OffsetDateTime dueDate() { - return this.innerProperties() == null ? null : this.innerProperties().dueDate(); - } - - /** - * Get the invoiceDate property: The date when the invoice was generated. - * - * @return the invoiceDate value. - */ - public OffsetDateTime invoiceDate() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceDate(); - } - - /** - * Get the status property: The current status of the invoice. - * - * @return the status value. - */ - public InvoiceStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the amountDue property: The amount due as of now. - * - * @return the amountDue value. - */ - public Amount amountDue() { - return this.innerProperties() == null ? null : this.innerProperties().amountDue(); - } - - /** - * Get the azurePrepaymentApplied property: The amount of Azure prepayment applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the azurePrepaymentApplied value. - */ - public Amount azurePrepaymentApplied() { - return this.innerProperties() == null ? null : this.innerProperties().azurePrepaymentApplied(); - } - - /** - * Get the billedAmount property: The total charges for the invoice billing period. - * - * @return the billedAmount value. - */ - public Amount billedAmount() { - return this.innerProperties() == null ? null : this.innerProperties().billedAmount(); - } - - /** - * Get the creditAmount property: The total refund for returns and cancellations during the invoice billing period. - * This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the creditAmount value. - */ - public Amount creditAmount() { - return this.innerProperties() == null ? null : this.innerProperties().creditAmount(); - } - - /** - * Get the freeAzureCreditApplied property: The amount of free Azure credits applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the freeAzureCreditApplied value. - */ - public Amount freeAzureCreditApplied() { - return this.innerProperties() == null ? null : this.innerProperties().freeAzureCreditApplied(); - } - - /** - * Get the subTotal property: The pre-tax amount due. This field is applicable to billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @return the subTotal value. - */ - public Amount subTotal() { - return this.innerProperties() == null ? null : this.innerProperties().subTotal(); - } - - /** - * Get the taxAmount property: The amount of tax charged for the billing period. This field is applicable to billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @return the taxAmount value. - */ - public Amount taxAmount() { - return this.innerProperties() == null ? null : this.innerProperties().taxAmount(); - } - - /** - * Get the totalAmount property: The amount due when the invoice was generated. This field is applicable to billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @return the totalAmount value. - */ - public Amount totalAmount() { - return this.innerProperties() == null ? null : this.innerProperties().totalAmount(); - } - - /** - * Get the invoicePeriodStartDate property: The start date of the billing period for which the invoice is generated. - * - * @return the invoicePeriodStartDate value. - */ - public OffsetDateTime invoicePeriodStartDate() { - return this.innerProperties() == null ? null : this.innerProperties().invoicePeriodStartDate(); - } - - /** - * Get the invoicePeriodEndDate property: The end date of the billing period for which the invoice is generated. - * - * @return the invoicePeriodEndDate value. - */ - public OffsetDateTime invoicePeriodEndDate() { - return this.innerProperties() == null ? null : this.innerProperties().invoicePeriodEndDate(); - } - - /** - * Get the invoiceType property: Invoice type. - * - * @return the invoiceType value. - */ - public InvoiceType invoiceType() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceType(); - } - - /** - * Get the isMonthlyInvoice property: Specifies if the invoice is generated as part of monthly invoicing cycle or - * not. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the isMonthlyInvoice value. - */ - public Boolean isMonthlyInvoice() { - return this.innerProperties() == null ? null : this.innerProperties().isMonthlyInvoice(); - } - - /** - * Get the billingProfileId property: The ID of the billing profile for which the invoice is generated. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile for which the invoice is generated. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); - } - - /** - * Get the purchaseOrderNumber property: An optional purchase order number for the invoice. - * - * @return the purchaseOrderNumber value. - */ - public String purchaseOrderNumber() { - return this.innerProperties() == null ? null : this.innerProperties().purchaseOrderNumber(); - } - - /** - * Get the documents property: List of documents available to download such as invoice and tax receipt. - * - * @return the documents value. - */ - public List documents() { - return this.innerProperties() == null ? null : this.innerProperties().documents(); - } - - /** - * Get the payments property: List of payments. - * - * @return the payments value. - */ - public List payments() { - return this.innerProperties() == null ? null : this.innerProperties().payments(); - } - - /** - * Get the rebillDetails property: Rebill details for an invoice. - * - * @return the rebillDetails value. - */ - public Map rebillDetails() { - return this.innerProperties() == null ? null : this.innerProperties().rebillDetails(); - } - - /** - * Get the documentType property: The type of the document. - * - * @return the documentType value. - */ - public InvoiceDocumentType documentType() { - return this.innerProperties() == null ? null : this.innerProperties().documentType(); - } - - /** - * Get the billedDocumentId property: The Id of the active invoice which is originally billed after this invoice was - * voided. This field is applicable to the void invoices only. - * - * @return the billedDocumentId value. - */ - public String billedDocumentId() { - return this.innerProperties() == null ? null : this.innerProperties().billedDocumentId(); - } - - /** - * Get the creditForDocumentId property: The Id of the invoice which got voided and this credit note was issued as a - * result. This field is applicable to the credit notes only. - * - * @return the creditForDocumentId value. - */ - public String creditForDocumentId() { - return this.innerProperties() == null ? null : this.innerProperties().creditForDocumentId(); - } - - /** - * Get the subscriptionId property: The ID of the subscription for which the invoice is generated. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceProperties.java deleted file mode 100644 index 3aea454342db..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceProperties.java +++ /dev/null @@ -1,474 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.Document; -import com.azure.resourcemanager.billing.models.InvoiceDocumentType; -import com.azure.resourcemanager.billing.models.InvoiceStatus; -import com.azure.resourcemanager.billing.models.InvoiceType; -import com.azure.resourcemanager.billing.models.PaymentProperties; -import com.azure.resourcemanager.billing.models.RebillDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** The properties of the invoice. */ -@Immutable -public final class InvoiceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoiceProperties.class); - - /* - * The due date for the invoice. - */ - @JsonProperty(value = "dueDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime dueDate; - - /* - * The date when the invoice was generated. - */ - @JsonProperty(value = "invoiceDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime invoiceDate; - - /* - * The current status of the invoice. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private InvoiceStatus status; - - /* - * The amount due as of now. - */ - @JsonProperty(value = "amountDue", access = JsonProperty.Access.WRITE_ONLY) - private Amount amountDue; - - /* - * The amount of Azure prepayment applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer - * Agreement. - */ - @JsonProperty(value = "azurePrepaymentApplied", access = JsonProperty.Access.WRITE_ONLY) - private Amount azurePrepaymentApplied; - - /* - * The total charges for the invoice billing period. - */ - @JsonProperty(value = "billedAmount", access = JsonProperty.Access.WRITE_ONLY) - private Amount billedAmount; - - /* - * The total refund for returns and cancellations during the invoice - * billing period. This field is applicable to billing accounts with - * agreement type Microsoft Customer Agreement. - */ - @JsonProperty(value = "creditAmount", access = JsonProperty.Access.WRITE_ONLY) - private Amount creditAmount; - - /* - * The amount of free Azure credits applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer - * Agreement. - */ - @JsonProperty(value = "freeAzureCreditApplied", access = JsonProperty.Access.WRITE_ONLY) - private Amount freeAzureCreditApplied; - - /* - * The pre-tax amount due. This field is applicable to billing accounts - * with agreement type Microsoft Customer Agreement. - */ - @JsonProperty(value = "subTotal", access = JsonProperty.Access.WRITE_ONLY) - private Amount subTotal; - - /* - * The amount of tax charged for the billing period. This field is - * applicable to billing accounts with agreement type Microsoft Customer - * Agreement. - */ - @JsonProperty(value = "taxAmount", access = JsonProperty.Access.WRITE_ONLY) - private Amount taxAmount; - - /* - * The amount due when the invoice was generated. This field is applicable - * to billing accounts with agreement type Microsoft Customer Agreement. - */ - @JsonProperty(value = "totalAmount", access = JsonProperty.Access.WRITE_ONLY) - private Amount totalAmount; - - /* - * The start date of the billing period for which the invoice is generated. - */ - @JsonProperty(value = "invoicePeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime invoicePeriodStartDate; - - /* - * The end date of the billing period for which the invoice is generated. - */ - @JsonProperty(value = "invoicePeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime invoicePeriodEndDate; - - /* - * Invoice type. - */ - @JsonProperty(value = "invoiceType", access = JsonProperty.Access.WRITE_ONLY) - private InvoiceType invoiceType; - - /* - * Specifies if the invoice is generated as part of monthly invoicing cycle - * or not. This field is applicable to billing accounts with agreement type - * Microsoft Customer Agreement. - */ - @JsonProperty(value = "isMonthlyInvoice", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isMonthlyInvoice; - - /* - * The ID of the billing profile for which the invoice is generated. - */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * The name of the billing profile for which the invoice is generated. - */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; - - /* - * An optional purchase order number for the invoice. - */ - @JsonProperty(value = "purchaseOrderNumber", access = JsonProperty.Access.WRITE_ONLY) - private String purchaseOrderNumber; - - /* - * List of documents available to download such as invoice and tax receipt. - */ - @JsonProperty(value = "documents", access = JsonProperty.Access.WRITE_ONLY) - private List documents; - - /* - * List of payments. - */ - @JsonProperty(value = "payments", access = JsonProperty.Access.WRITE_ONLY) - private List payments; - - /* - * Rebill details for an invoice. - */ - @JsonProperty(value = "rebillDetails", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map rebillDetails; - - /* - * The type of the document. - */ - @JsonProperty(value = "documentType", access = JsonProperty.Access.WRITE_ONLY) - private InvoiceDocumentType documentType; - - /* - * The Id of the active invoice which is originally billed after this - * invoice was voided. This field is applicable to the void invoices only. - */ - @JsonProperty(value = "billedDocumentId", access = JsonProperty.Access.WRITE_ONLY) - private String billedDocumentId; - - /* - * The Id of the invoice which got voided and this credit note was issued - * as a result. This field is applicable to the credit notes only. - */ - @JsonProperty(value = "creditForDocumentId", access = JsonProperty.Access.WRITE_ONLY) - private String creditForDocumentId; - - /* - * The ID of the subscription for which the invoice is generated. - */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; - - /** - * Get the dueDate property: The due date for the invoice. - * - * @return the dueDate value. - */ - public OffsetDateTime dueDate() { - return this.dueDate; - } - - /** - * Get the invoiceDate property: The date when the invoice was generated. - * - * @return the invoiceDate value. - */ - public OffsetDateTime invoiceDate() { - return this.invoiceDate; - } - - /** - * Get the status property: The current status of the invoice. - * - * @return the status value. - */ - public InvoiceStatus status() { - return this.status; - } - - /** - * Get the amountDue property: The amount due as of now. - * - * @return the amountDue value. - */ - public Amount amountDue() { - return this.amountDue; - } - - /** - * Get the azurePrepaymentApplied property: The amount of Azure prepayment applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the azurePrepaymentApplied value. - */ - public Amount azurePrepaymentApplied() { - return this.azurePrepaymentApplied; - } - - /** - * Get the billedAmount property: The total charges for the invoice billing period. - * - * @return the billedAmount value. - */ - public Amount billedAmount() { - return this.billedAmount; - } - - /** - * Get the creditAmount property: The total refund for returns and cancellations during the invoice billing period. - * This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the creditAmount value. - */ - public Amount creditAmount() { - return this.creditAmount; - } - - /** - * Get the freeAzureCreditApplied property: The amount of free Azure credits applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the freeAzureCreditApplied value. - */ - public Amount freeAzureCreditApplied() { - return this.freeAzureCreditApplied; - } - - /** - * Get the subTotal property: The pre-tax amount due. This field is applicable to billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @return the subTotal value. - */ - public Amount subTotal() { - return this.subTotal; - } - - /** - * Get the taxAmount property: The amount of tax charged for the billing period. This field is applicable to billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @return the taxAmount value. - */ - public Amount taxAmount() { - return this.taxAmount; - } - - /** - * Get the totalAmount property: The amount due when the invoice was generated. This field is applicable to billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @return the totalAmount value. - */ - public Amount totalAmount() { - return this.totalAmount; - } - - /** - * Get the invoicePeriodStartDate property: The start date of the billing period for which the invoice is generated. - * - * @return the invoicePeriodStartDate value. - */ - public OffsetDateTime invoicePeriodStartDate() { - return this.invoicePeriodStartDate; - } - - /** - * Get the invoicePeriodEndDate property: The end date of the billing period for which the invoice is generated. - * - * @return the invoicePeriodEndDate value. - */ - public OffsetDateTime invoicePeriodEndDate() { - return this.invoicePeriodEndDate; - } - - /** - * Get the invoiceType property: Invoice type. - * - * @return the invoiceType value. - */ - public InvoiceType invoiceType() { - return this.invoiceType; - } - - /** - * Get the isMonthlyInvoice property: Specifies if the invoice is generated as part of monthly invoicing cycle or - * not. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the isMonthlyInvoice value. - */ - public Boolean isMonthlyInvoice() { - return this.isMonthlyInvoice; - } - - /** - * Get the billingProfileId property: The ID of the billing profile for which the invoice is generated. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.billingProfileId; - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile for which the invoice is generated. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; - } - - /** - * Get the purchaseOrderNumber property: An optional purchase order number for the invoice. - * - * @return the purchaseOrderNumber value. - */ - public String purchaseOrderNumber() { - return this.purchaseOrderNumber; - } - - /** - * Get the documents property: List of documents available to download such as invoice and tax receipt. - * - * @return the documents value. - */ - public List documents() { - return this.documents; - } - - /** - * Get the payments property: List of payments. - * - * @return the payments value. - */ - public List payments() { - return this.payments; - } - - /** - * Get the rebillDetails property: Rebill details for an invoice. - * - * @return the rebillDetails value. - */ - public Map rebillDetails() { - return this.rebillDetails; - } - - /** - * Get the documentType property: The type of the document. - * - * @return the documentType value. - */ - public InvoiceDocumentType documentType() { - return this.documentType; - } - - /** - * Get the billedDocumentId property: The Id of the active invoice which is originally billed after this invoice was - * voided. This field is applicable to the void invoices only. - * - * @return the billedDocumentId value. - */ - public String billedDocumentId() { - return this.billedDocumentId; - } - - /** - * Get the creditForDocumentId property: The Id of the invoice which got voided and this credit note was issued as a - * result. This field is applicable to the credit notes only. - * - * @return the creditForDocumentId value. - */ - public String creditForDocumentId() { - return this.creditForDocumentId; - } - - /** - * Get the subscriptionId property: The ID of the subscription for which the invoice is generated. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (amountDue() != null) { - amountDue().validate(); - } - if (azurePrepaymentApplied() != null) { - azurePrepaymentApplied().validate(); - } - if (billedAmount() != null) { - billedAmount().validate(); - } - if (creditAmount() != null) { - creditAmount().validate(); - } - if (freeAzureCreditApplied() != null) { - freeAzureCreditApplied().validate(); - } - if (subTotal() != null) { - subTotal().validate(); - } - if (taxAmount() != null) { - taxAmount().validate(); - } - if (totalAmount() != null) { - totalAmount().validate(); - } - if (documents() != null) { - documents().forEach(e -> e.validate()); - } - if (payments() != null) { - payments().forEach(e -> e.validate()); - } - if (rebillDetails() != null) { - rebillDetails() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionInner.java deleted file mode 100644 index b769f4fc3d2e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionInner.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.InvoiceSectionState; -import com.azure.resourcemanager.billing.models.TargetCloud; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An invoice section. */ -@Fluent -public final class InvoiceSectionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoiceSectionInner.class); - - /* - * The properties of an invoice section. - */ - @JsonProperty(value = "properties") - private InvoiceSectionProperties innerProperties; - - /** - * Get the innerProperties property: The properties of an invoice section. - * - * @return the innerProperties value. - */ - private InvoiceSectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: The name of the invoice section. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The name of the invoice section. - * - * @param displayName the displayName value to set. - * @return the InvoiceSectionInner object itself. - */ - public InvoiceSectionInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new InvoiceSectionProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the labels property: Dictionary of metadata associated with the invoice section. - * - * @return the labels value. - */ - public Map labels() { - return this.innerProperties() == null ? null : this.innerProperties().labels(); - } - - /** - * Set the labels property: Dictionary of metadata associated with the invoice section. - * - * @param labels the labels value to set. - * @return the InvoiceSectionInner object itself. - */ - public InvoiceSectionInner withLabels(Map labels) { - if (this.innerProperties() == null) { - this.innerProperties = new InvoiceSectionProperties(); - } - this.innerProperties().withLabels(labels); - return this; - } - - /** - * Get the state property: Identifies the state of an invoice section. - * - * @return the state value. - */ - public InvoiceSectionState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the systemId property: The system generated unique identifier for an invoice section. - * - * @return the systemId value. - */ - public String systemId() { - return this.innerProperties() == null ? null : this.innerProperties().systemId(); - } - - /** - * Get the tags property: Dictionary of metadata associated with the invoice section. Maximum key/value length - * supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ - * ? /. - * - * @return the tags value. - */ - public Map tags() { - return this.innerProperties() == null ? null : this.innerProperties().tags(); - } - - /** - * Set the tags property: Dictionary of metadata associated with the invoice section. Maximum key/value length - * supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ - * ? /. - * - * @param tags the tags value to set. - * @return the InvoiceSectionInner object itself. - */ - public InvoiceSectionInner withTags(Map tags) { - if (this.innerProperties() == null) { - this.innerProperties = new InvoiceSectionProperties(); - } - this.innerProperties().withTags(tags); - return this; - } - - /** - * Get the targetCloud property: Identifies the cloud environments that are associated with an invoice section. This - * is a system managed optional field and gets updated as the invoice section gets associated with accounts in - * various clouds. - * - * @return the targetCloud value. - */ - public TargetCloud targetCloud() { - return this.innerProperties() == null ? null : this.innerProperties().targetCloud(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionProperties.java deleted file mode 100644 index b8e12e1be0d8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionProperties.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.InvoiceSectionState; -import com.azure.resourcemanager.billing.models.TargetCloud; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The properties of an invoice section. */ -@Fluent -public final class InvoiceSectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoiceSectionProperties.class); - - /* - * The name of the invoice section. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Dictionary of metadata associated with the invoice section. - */ - @JsonProperty(value = "labels") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map labels; - - /* - * Identifies the state of an invoice section. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private InvoiceSectionState state; - - /* - * The system generated unique identifier for an invoice section. - */ - @JsonProperty(value = "systemId", access = JsonProperty.Access.WRITE_ONLY) - private String systemId; - - /* - * Dictionary of metadata associated with the invoice section. Maximum - * key/value length supported of 256 characters. Keys/value should not - * empty value nor null. Keys can not contain < > % & \ ? / - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /* - * Identifies the cloud environments that are associated with an invoice - * section. This is a system managed optional field and gets updated as the - * invoice section gets associated with accounts in various clouds. - */ - @JsonProperty(value = "targetCloud", access = JsonProperty.Access.WRITE_ONLY) - private TargetCloud targetCloud; - - /** - * Get the displayName property: The name of the invoice section. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The name of the invoice section. - * - * @param displayName the displayName value to set. - * @return the InvoiceSectionProperties object itself. - */ - public InvoiceSectionProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the labels property: Dictionary of metadata associated with the invoice section. - * - * @return the labels value. - */ - public Map labels() { - return this.labels; - } - - /** - * Set the labels property: Dictionary of metadata associated with the invoice section. - * - * @param labels the labels value to set. - * @return the InvoiceSectionProperties object itself. - */ - public InvoiceSectionProperties withLabels(Map labels) { - this.labels = labels; - return this; - } - - /** - * Get the state property: Identifies the state of an invoice section. - * - * @return the state value. - */ - public InvoiceSectionState state() { - return this.state; - } - - /** - * Get the systemId property: The system generated unique identifier for an invoice section. - * - * @return the systemId value. - */ - public String systemId() { - return this.systemId; - } - - /** - * Get the tags property: Dictionary of metadata associated with the invoice section. Maximum key/value length - * supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ - * ? /. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Dictionary of metadata associated with the invoice section. Maximum key/value length - * supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ - * ? /. - * - * @param tags the tags value to set. - * @return the InvoiceSectionProperties object itself. - */ - public InvoiceSectionProperties withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the targetCloud property: Identifies the cloud environments that are associated with an invoice section. This - * is a system managed optional field and gets updated as the invoice section gets associated with accounts in - * various clouds. - * - * @return the targetCloud value. - */ - public TargetCloud targetCloud() { - return this.targetCloud; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionWithCreateSubPermissionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionWithCreateSubPermissionInner.java deleted file mode 100644 index b704b84fb1e8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionWithCreateSubPermissionInner.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.BillingProfileStatus; -import com.azure.resourcemanager.billing.models.SpendingLimitForBillingProfile; -import com.azure.resourcemanager.billing.models.StatusReasonCodeForBillingProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Invoice section properties with create subscription permission. */ -@Fluent -public final class InvoiceSectionWithCreateSubPermissionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoiceSectionWithCreateSubPermissionInner.class); - - /* - * The ID of the invoice section. - */ - @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; - - /* - * The name of the invoice section. - */ - @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionDisplayName; - - /* - * The system generated unique identifier for an invoice section. - */ - @JsonProperty(value = "invoiceSectionSystemId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionSystemId; - - /* - * The ID of the billing profile for the invoice section. - */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * The name of the billing profile for the invoice section. - */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; - - /* - * The status of the billing profile. - */ - @JsonProperty(value = "billingProfileStatus", access = JsonProperty.Access.WRITE_ONLY) - private BillingProfileStatus billingProfileStatus; - - /* - * Reason for the specified billing profile status. - */ - @JsonProperty(value = "billingProfileStatusReasonCode", access = JsonProperty.Access.WRITE_ONLY) - private StatusReasonCodeForBillingProfile billingProfileStatusReasonCode; - - /* - * The billing profile spending limit. - */ - @JsonProperty(value = "billingProfileSpendingLimit", access = JsonProperty.Access.WRITE_ONLY) - private SpendingLimitForBillingProfile billingProfileSpendingLimit; - - /* - * The system generated unique identifier for a billing profile. - */ - @JsonProperty(value = "billingProfileSystemId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileSystemId; - - /* - * Enabled azure plans for the associated billing profile. - */ - @JsonProperty(value = "enabledAzurePlans") - private List enabledAzurePlans; - - /** - * Get the invoiceSectionId property: The ID of the invoice section. - * - * @return the invoiceSectionId value. - */ - public String invoiceSectionId() { - return this.invoiceSectionId; - } - - /** - * Get the invoiceSectionDisplayName property: The name of the invoice section. - * - * @return the invoiceSectionDisplayName value. - */ - public String invoiceSectionDisplayName() { - return this.invoiceSectionDisplayName; - } - - /** - * Get the invoiceSectionSystemId property: The system generated unique identifier for an invoice section. - * - * @return the invoiceSectionSystemId value. - */ - public String invoiceSectionSystemId() { - return this.invoiceSectionSystemId; - } - - /** - * Get the billingProfileId property: The ID of the billing profile for the invoice section. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.billingProfileId; - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile for the invoice section. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; - } - - /** - * Get the billingProfileStatus property: The status of the billing profile. - * - * @return the billingProfileStatus value. - */ - public BillingProfileStatus billingProfileStatus() { - return this.billingProfileStatus; - } - - /** - * Get the billingProfileStatusReasonCode property: Reason for the specified billing profile status. - * - * @return the billingProfileStatusReasonCode value. - */ - public StatusReasonCodeForBillingProfile billingProfileStatusReasonCode() { - return this.billingProfileStatusReasonCode; - } - - /** - * Get the billingProfileSpendingLimit property: The billing profile spending limit. - * - * @return the billingProfileSpendingLimit value. - */ - public SpendingLimitForBillingProfile billingProfileSpendingLimit() { - return this.billingProfileSpendingLimit; - } - - /** - * Get the billingProfileSystemId property: The system generated unique identifier for a billing profile. - * - * @return the billingProfileSystemId value. - */ - public String billingProfileSystemId() { - return this.billingProfileSystemId; - } - - /** - * Get the enabledAzurePlans property: Enabled azure plans for the associated billing profile. - * - * @return the enabledAzurePlans value. - */ - public List enabledAzurePlans() { - return this.enabledAzurePlans; - } - - /** - * Set the enabledAzurePlans property: Enabled azure plans for the associated billing profile. - * - * @param enabledAzurePlans the enabledAzurePlans value to set. - * @return the InvoiceSectionWithCreateSubPermissionInner object itself. - */ - public InvoiceSectionWithCreateSubPermissionInner withEnabledAzurePlans(List enabledAzurePlans) { - this.enabledAzurePlans = enabledAzurePlans; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (enabledAzurePlans() != null) { - enabledAzurePlans().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/OperationInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/OperationInner.java deleted file mode 100644 index 707ca148c7ee..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/OperationInner.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A Billing REST API operation. */ -@Fluent -public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - - /* - * Operation name: {provider}/{resource}/{operation}. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Identifies if the operation is a data operation. - */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDataAction; - - /* - * The object that represents the operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Identifies if the operation is a data operation. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: The object that represents the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: The object that represents the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyInner.java deleted file mode 100644 index cd9cd98539e1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyInner.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A policy. */ -@Fluent -public final class PolicyInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyInner.class); - - /* - * The properties of a policy. - */ - @JsonProperty(value = "properties") - private PolicyProperties innerProperties; - - /** - * Get the innerProperties property: The properties of a policy. - * - * @return the innerProperties value. - */ - private PolicyProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the marketplacePurchases property: The policy that controls whether Azure marketplace purchases are allowed - * for a billing profile. - * - * @return the marketplacePurchases value. - */ - public MarketplacePurchasesPolicy marketplacePurchases() { - return this.innerProperties() == null ? null : this.innerProperties().marketplacePurchases(); - } - - /** - * Set the marketplacePurchases property: The policy that controls whether Azure marketplace purchases are allowed - * for a billing profile. - * - * @param marketplacePurchases the marketplacePurchases value to set. - * @return the PolicyInner object itself. - */ - public PolicyInner withMarketplacePurchases(MarketplacePurchasesPolicy marketplacePurchases) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyProperties(); - } - this.innerProperties().withMarketplacePurchases(marketplacePurchases); - return this; - } - - /** - * Get the reservationPurchases property: The policy that controls whether Azure reservation purchases are allowed - * for a billing profile. - * - * @return the reservationPurchases value. - */ - public ReservationPurchasesPolicy reservationPurchases() { - return this.innerProperties() == null ? null : this.innerProperties().reservationPurchases(); - } - - /** - * Set the reservationPurchases property: The policy that controls whether Azure reservation purchases are allowed - * for a billing profile. - * - * @param reservationPurchases the reservationPurchases value to set. - * @return the PolicyInner object itself. - */ - public PolicyInner withReservationPurchases(ReservationPurchasesPolicy reservationPurchases) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyProperties(); - } - this.innerProperties().withReservationPurchases(reservationPurchases); - return this; - } - - /** - * Get the viewCharges property: The policy that controls whether users with Azure RBAC access to a subscription can - * view its charges. - * - * @return the viewCharges value. - */ - public ViewChargesPolicy viewCharges() { - return this.innerProperties() == null ? null : this.innerProperties().viewCharges(); - } - - /** - * Set the viewCharges property: The policy that controls whether users with Azure RBAC access to a subscription can - * view its charges. - * - * @param viewCharges the viewCharges value to set. - * @return the PolicyInner object itself. - */ - public PolicyInner withViewCharges(ViewChargesPolicy viewCharges) { - if (this.innerProperties() == null) { - this.innerProperties = new PolicyProperties(); - } - this.innerProperties().withViewCharges(viewCharges); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyProperties.java deleted file mode 100644 index 296c53526cf7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyProperties.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a policy. */ -@Fluent -public final class PolicyProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyProperties.class); - - /* - * The policy that controls whether Azure marketplace purchases are allowed - * for a billing profile. - */ - @JsonProperty(value = "marketplacePurchases") - private MarketplacePurchasesPolicy marketplacePurchases; - - /* - * The policy that controls whether Azure reservation purchases are allowed - * for a billing profile. - */ - @JsonProperty(value = "reservationPurchases") - private ReservationPurchasesPolicy reservationPurchases; - - /* - * The policy that controls whether users with Azure RBAC access to a - * subscription can view its charges. - */ - @JsonProperty(value = "viewCharges") - private ViewChargesPolicy viewCharges; - - /** - * Get the marketplacePurchases property: The policy that controls whether Azure marketplace purchases are allowed - * for a billing profile. - * - * @return the marketplacePurchases value. - */ - public MarketplacePurchasesPolicy marketplacePurchases() { - return this.marketplacePurchases; - } - - /** - * Set the marketplacePurchases property: The policy that controls whether Azure marketplace purchases are allowed - * for a billing profile. - * - * @param marketplacePurchases the marketplacePurchases value to set. - * @return the PolicyProperties object itself. - */ - public PolicyProperties withMarketplacePurchases(MarketplacePurchasesPolicy marketplacePurchases) { - this.marketplacePurchases = marketplacePurchases; - return this; - } - - /** - * Get the reservationPurchases property: The policy that controls whether Azure reservation purchases are allowed - * for a billing profile. - * - * @return the reservationPurchases value. - */ - public ReservationPurchasesPolicy reservationPurchases() { - return this.reservationPurchases; - } - - /** - * Set the reservationPurchases property: The policy that controls whether Azure reservation purchases are allowed - * for a billing profile. - * - * @param reservationPurchases the reservationPurchases value to set. - * @return the PolicyProperties object itself. - */ - public PolicyProperties withReservationPurchases(ReservationPurchasesPolicy reservationPurchases) { - this.reservationPurchases = reservationPurchases; - return this; - } - - /** - * Get the viewCharges property: The policy that controls whether users with Azure RBAC access to a subscription can - * view its charges. - * - * @return the viewCharges value. - */ - public ViewChargesPolicy viewCharges() { - return this.viewCharges; - } - - /** - * Set the viewCharges property: The policy that controls whether users with Azure RBAC access to a subscription can - * view its charges. - * - * @param viewCharges the viewCharges value to set. - * @return the PolicyProperties object itself. - */ - public PolicyProperties withViewCharges(ViewChargesPolicy viewCharges) { - this.viewCharges = viewCharges; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductInner.java deleted file mode 100644 index 90b4a875f27d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductInner.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import com.azure.resourcemanager.billing.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A product. */ -@Fluent -public final class ProductInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductInner.class); - - /* - * The properties of a product. - */ - @JsonProperty(value = "properties") - private ProductProperties innerProperties; - - /** - * Get the innerProperties property: The properties of a product. - * - * @return the innerProperties value. - */ - private ProductProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the autoRenew property: Indicates whether auto renewal is turned on or off for a product. - * - * @return the autoRenew value. - */ - public AutoRenew autoRenew() { - return this.innerProperties() == null ? null : this.innerProperties().autoRenew(); - } - - /** - * Set the autoRenew property: Indicates whether auto renewal is turned on or off for a product. - * - * @param autoRenew the autoRenew value to set. - * @return the ProductInner object itself. - */ - public ProductInner withAutoRenew(AutoRenew autoRenew) { - if (this.innerProperties() == null) { - this.innerProperties = new ProductProperties(); - } - this.innerProperties().withAutoRenew(autoRenew); - return this; - } - - /** - * Get the displayName property: The display name of the product. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the purchaseDate property: The date when the product was purchased. - * - * @return the purchaseDate value. - */ - public OffsetDateTime purchaseDate() { - return this.innerProperties() == null ? null : this.innerProperties().purchaseDate(); - } - - /** - * Get the productTypeId property: The ID of the type of product. - * - * @return the productTypeId value. - */ - public String productTypeId() { - return this.innerProperties() == null ? null : this.innerProperties().productTypeId(); - } - - /** - * Get the productType property: The description of the type of product. - * - * @return the productType value. - */ - public String productType() { - return this.innerProperties() == null ? null : this.innerProperties().productType(); - } - - /** - * Get the status property: The current status of the product. - * - * @return the status value. - */ - public ProductStatusType status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The current status of the product. - * - * @param status the status value to set. - * @return the ProductInner object itself. - */ - public ProductInner withStatus(ProductStatusType status) { - if (this.innerProperties() == null) { - this.innerProperties = new ProductProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the endDate property: The date when the product will be renewed or canceled. - * - * @return the endDate value. - */ - public OffsetDateTime endDate() { - return this.innerProperties() == null ? null : this.innerProperties().endDate(); - } - - /** - * Get the billingFrequency property: The frequency at which the product will be billed. - * - * @return the billingFrequency value. - */ - public BillingFrequency billingFrequency() { - return this.innerProperties() == null ? null : this.innerProperties().billingFrequency(); - } - - /** - * Set the billingFrequency property: The frequency at which the product will be billed. - * - * @param billingFrequency the billingFrequency value to set. - * @return the ProductInner object itself. - */ - public ProductInner withBillingFrequency(BillingFrequency billingFrequency) { - if (this.innerProperties() == null) { - this.innerProperties = new ProductProperties(); - } - this.innerProperties().withBillingFrequency(billingFrequency); - return this; - } - - /** - * Get the lastCharge property: The last month charges. - * - * @return the lastCharge value. - */ - public Amount lastCharge() { - return this.innerProperties() == null ? null : this.innerProperties().lastCharge(); - } - - /** - * Get the lastChargeDate property: The date of the last charge. - * - * @return the lastChargeDate value. - */ - public OffsetDateTime lastChargeDate() { - return this.innerProperties() == null ? null : this.innerProperties().lastChargeDate(); - } - - /** - * Get the quantity property: The quantity purchased for the product. - * - * @return the quantity value. - */ - public Float quantity() { - return this.innerProperties() == null ? null : this.innerProperties().quantity(); - } - - /** - * Get the skuId property: The sku ID of the product. - * - * @return the skuId value. - */ - public String skuId() { - return this.innerProperties() == null ? null : this.innerProperties().skuId(); - } - - /** - * Get the skuDescription property: The sku description of the product. - * - * @return the skuDescription value. - */ - public String skuDescription() { - return this.innerProperties() == null ? null : this.innerProperties().skuDescription(); - } - - /** - * Get the tenantId property: The id of the tenant in which the product is used. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.innerProperties() == null ? null : this.innerProperties().tenantId(); - } - - /** - * Get the availabilityId property: The availability of the product. - * - * @return the availabilityId value. - */ - public String availabilityId() { - return this.innerProperties() == null ? null : this.innerProperties().availabilityId(); - } - - /** - * Get the invoiceSectionId property: The ID of the invoice section to which the product is billed. - * - * @return the invoiceSectionId value. - */ - public String invoiceSectionId() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); - } - - /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the product is billed. - * - * @return the invoiceSectionDisplayName value. - */ - public String invoiceSectionDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); - } - - /** - * Get the billingProfileId property: The ID of the billing profile to which the product is billed. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the product is billed. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); - } - - /** - * Get the customerId property: The ID of the customer for whom the product was purchased. The field is applicable - * only for Microsoft Partner Agreement billing account. - * - * @return the customerId value. - */ - public String customerId() { - return this.innerProperties() == null ? null : this.innerProperties().customerId(); - } - - /** - * Get the customerDisplayName property: The name of the customer for whom the product was purchased. The field is - * applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerDisplayName value. - */ - public String customerDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().customerDisplayName(); - } - - /** - * Get the reseller property: Reseller for this product. - * - * @return the reseller value. - */ - public Reseller reseller() { - return this.innerProperties() == null ? null : this.innerProperties().reseller(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductProperties.java deleted file mode 100644 index a36d2f3d632f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ProductProperties.java +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import com.azure.resourcemanager.billing.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a product. */ -@Fluent -public final class ProductProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductProperties.class); - - /* - * Indicates whether auto renewal is turned on or off for a product. - */ - @JsonProperty(value = "autoRenew") - private AutoRenew autoRenew; - - /* - * The display name of the product. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * The date when the product was purchased. - */ - @JsonProperty(value = "purchaseDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime purchaseDate; - - /* - * The ID of the type of product. - */ - @JsonProperty(value = "productTypeId", access = JsonProperty.Access.WRITE_ONLY) - private String productTypeId; - - /* - * The description of the type of product. - */ - @JsonProperty(value = "productType", access = JsonProperty.Access.WRITE_ONLY) - private String productType; - - /* - * The current status of the product. - */ - @JsonProperty(value = "status") - private ProductStatusType status; - - /* - * The date when the product will be renewed or canceled. - */ - @JsonProperty(value = "endDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime endDate; - - /* - * The frequency at which the product will be billed. - */ - @JsonProperty(value = "billingFrequency") - private BillingFrequency billingFrequency; - - /* - * The last month charges. - */ - @JsonProperty(value = "lastCharge", access = JsonProperty.Access.WRITE_ONLY) - private Amount lastCharge; - - /* - * The date of the last charge. - */ - @JsonProperty(value = "lastChargeDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastChargeDate; - - /* - * The quantity purchased for the product. - */ - @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) - private Float quantity; - - /* - * The sku ID of the product. - */ - @JsonProperty(value = "skuId", access = JsonProperty.Access.WRITE_ONLY) - private String skuId; - - /* - * The sku description of the product. - */ - @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) - private String skuDescription; - - /* - * The id of the tenant in which the product is used. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The availability of the product. - */ - @JsonProperty(value = "availabilityId", access = JsonProperty.Access.WRITE_ONLY) - private String availabilityId; - - /* - * The ID of the invoice section to which the product is billed. - */ - @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; - - /* - * The name of the invoice section to which the product is billed. - */ - @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionDisplayName; - - /* - * The ID of the billing profile to which the product is billed. - */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * The name of the billing profile to which the product is billed. - */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; - - /* - * The ID of the customer for whom the product was purchased. The field is - * applicable only for Microsoft Partner Agreement billing account. - */ - @JsonProperty(value = "customerId", access = JsonProperty.Access.WRITE_ONLY) - private String customerId; - - /* - * The name of the customer for whom the product was purchased. The field - * is applicable only for Microsoft Partner Agreement billing account. - */ - @JsonProperty(value = "customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String customerDisplayName; - - /* - * Reseller for this product. - */ - @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY) - private Reseller reseller; - - /** - * Get the autoRenew property: Indicates whether auto renewal is turned on or off for a product. - * - * @return the autoRenew value. - */ - public AutoRenew autoRenew() { - return this.autoRenew; - } - - /** - * Set the autoRenew property: Indicates whether auto renewal is turned on or off for a product. - * - * @param autoRenew the autoRenew value to set. - * @return the ProductProperties object itself. - */ - public ProductProperties withAutoRenew(AutoRenew autoRenew) { - this.autoRenew = autoRenew; - return this; - } - - /** - * Get the displayName property: The display name of the product. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the purchaseDate property: The date when the product was purchased. - * - * @return the purchaseDate value. - */ - public OffsetDateTime purchaseDate() { - return this.purchaseDate; - } - - /** - * Get the productTypeId property: The ID of the type of product. - * - * @return the productTypeId value. - */ - public String productTypeId() { - return this.productTypeId; - } - - /** - * Get the productType property: The description of the type of product. - * - * @return the productType value. - */ - public String productType() { - return this.productType; - } - - /** - * Get the status property: The current status of the product. - * - * @return the status value. - */ - public ProductStatusType status() { - return this.status; - } - - /** - * Set the status property: The current status of the product. - * - * @param status the status value to set. - * @return the ProductProperties object itself. - */ - public ProductProperties withStatus(ProductStatusType status) { - this.status = status; - return this; - } - - /** - * Get the endDate property: The date when the product will be renewed or canceled. - * - * @return the endDate value. - */ - public OffsetDateTime endDate() { - return this.endDate; - } - - /** - * Get the billingFrequency property: The frequency at which the product will be billed. - * - * @return the billingFrequency value. - */ - public BillingFrequency billingFrequency() { - return this.billingFrequency; - } - - /** - * Set the billingFrequency property: The frequency at which the product will be billed. - * - * @param billingFrequency the billingFrequency value to set. - * @return the ProductProperties object itself. - */ - public ProductProperties withBillingFrequency(BillingFrequency billingFrequency) { - this.billingFrequency = billingFrequency; - return this; - } - - /** - * Get the lastCharge property: The last month charges. - * - * @return the lastCharge value. - */ - public Amount lastCharge() { - return this.lastCharge; - } - - /** - * Get the lastChargeDate property: The date of the last charge. - * - * @return the lastChargeDate value. - */ - public OffsetDateTime lastChargeDate() { - return this.lastChargeDate; - } - - /** - * Get the quantity property: The quantity purchased for the product. - * - * @return the quantity value. - */ - public Float quantity() { - return this.quantity; - } - - /** - * Get the skuId property: The sku ID of the product. - * - * @return the skuId value. - */ - public String skuId() { - return this.skuId; - } - - /** - * Get the skuDescription property: The sku description of the product. - * - * @return the skuDescription value. - */ - public String skuDescription() { - return this.skuDescription; - } - - /** - * Get the tenantId property: The id of the tenant in which the product is used. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the availabilityId property: The availability of the product. - * - * @return the availabilityId value. - */ - public String availabilityId() { - return this.availabilityId; - } - - /** - * Get the invoiceSectionId property: The ID of the invoice section to which the product is billed. - * - * @return the invoiceSectionId value. - */ - public String invoiceSectionId() { - return this.invoiceSectionId; - } - - /** - * Get the invoiceSectionDisplayName property: The name of the invoice section to which the product is billed. - * - * @return the invoiceSectionDisplayName value. - */ - public String invoiceSectionDisplayName() { - return this.invoiceSectionDisplayName; - } - - /** - * Get the billingProfileId property: The ID of the billing profile to which the product is billed. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.billingProfileId; - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile to which the product is billed. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; - } - - /** - * Get the customerId property: The ID of the customer for whom the product was purchased. The field is applicable - * only for Microsoft Partner Agreement billing account. - * - * @return the customerId value. - */ - public String customerId() { - return this.customerId; - } - - /** - * Get the customerDisplayName property: The name of the customer for whom the product was purchased. The field is - * applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerDisplayName value. - */ - public String customerDisplayName() { - return this.customerDisplayName; - } - - /** - * Get the reseller property: Reseller for this product. - * - * @return the reseller value. - */ - public Reseller reseller() { - return this.reseller; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (lastCharge() != null) { - lastCharge().validate(); - } - if (reseller() != null) { - reseller().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationInner.java deleted file mode 100644 index 745deab65982..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationInner.java +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.ReservationPropertyUtilization; -import com.azure.resourcemanager.billing.models.ReservationSkuProperty; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The definition of the reservation. */ -@Fluent -public final class ReservationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationInner.class); - - /* - * The id of the reservation. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The name of the reservation. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The type of the reservation. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * The location of the reservation. - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /* - * The sku information associated to this reservation - */ - @JsonProperty(value = "sku") - private ReservationSkuProperty sku; - - /* - * The properties associated to this reservation - */ - @JsonProperty(value = "properties") - private ReservationProperty innerProperties; - - /** - * Get the id property: The id of the reservation. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: The name of the reservation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: The type of the reservation. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the location property: The location of the reservation. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the sku property: The sku information associated to this reservation. - * - * @return the sku value. - */ - public ReservationSkuProperty sku() { - return this.sku; - } - - /** - * Set the sku property: The sku information associated to this reservation. - * - * @param sku the sku value to set. - * @return the ReservationInner object itself. - */ - public ReservationInner withSku(ReservationSkuProperty sku) { - this.sku = sku; - return this; - } - - /** - * Get the innerProperties property: The properties associated to this reservation. - * - * @return the innerProperties value. - */ - private ReservationProperty innerProperties() { - return this.innerProperties; - } - - /** - * Get the appliedScopes property: The array of applied scopes of a reservation. Will be null if the reservation is - * in Shared scope. - * - * @return the appliedScopes value. - */ - public List appliedScopes() { - return this.innerProperties() == null ? null : this.innerProperties().appliedScopes(); - } - - /** - * Set the appliedScopes property: The array of applied scopes of a reservation. Will be null if the reservation is - * in Shared scope. - * - * @param appliedScopes the appliedScopes value to set. - * @return the ReservationInner object itself. - */ - public ReservationInner withAppliedScopes(List appliedScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new ReservationProperty(); - } - this.innerProperties().withAppliedScopes(appliedScopes); - return this; - } - - /** - * Get the appliedScopeType property: The applied scope type of the reservation. - * - * @return the appliedScopeType value. - */ - public String appliedScopeType() { - return this.innerProperties() == null ? null : this.innerProperties().appliedScopeType(); - } - - /** - * Get the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine. - * - * @return the reservedResourceType value. - */ - public String reservedResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().reservedResourceType(); - } - - /** - * Get the quantity property: The number of the reservation. - * - * @return the quantity value. - */ - public Float quantity() { - return this.innerProperties() == null ? null : this.innerProperties().quantity(); - } - - /** - * Get the provisioningState property: The provisioning state of the reservation, e.g. Succeeded. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the expiryDate property: The expiry date of the reservation. - * - * @return the expiryDate value. - */ - public String expiryDate() { - return this.innerProperties() == null ? null : this.innerProperties().expiryDate(); - } - - /** - * Get the provisioningSubState property: The provisioning state of the reservation, e.g. Succeeded. - * - * @return the provisioningSubState value. - */ - public String provisioningSubState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningSubState(); - } - - /** - * Get the displayName property: The display name of the reservation. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the displayProvisioningState property: The provisioning state of the reservation for display, e.g. Succeeded. - * - * @return the displayProvisioningState value. - */ - public String displayProvisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().displayProvisioningState(); - } - - /** - * Get the userFriendlyRenewState property: The renew state of the reservation for display, e.g. On. - * - * @return the userFriendlyRenewState value. - */ - public String userFriendlyRenewState() { - return this.innerProperties() == null ? null : this.innerProperties().userFriendlyRenewState(); - } - - /** - * Get the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g. - * Shared. - * - * @return the userFriendlyAppliedScopeType value. - */ - public String userFriendlyAppliedScopeType() { - return this.innerProperties() == null ? null : this.innerProperties().userFriendlyAppliedScopeType(); - } - - /** - * Get the effectiveDateTime property: The effective date time of the reservation. - * - * @return the effectiveDateTime value. - */ - public String effectiveDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().effectiveDateTime(); - } - - /** - * Get the skuDescription property: The sku description of the reservation. - * - * @return the skuDescription value. - */ - public String skuDescription() { - return this.innerProperties() == null ? null : this.innerProperties().skuDescription(); - } - - /** - * Get the term property: The term of the reservation, e.g. P1Y. - * - * @return the term value. - */ - public String term() { - return this.innerProperties() == null ? null : this.innerProperties().term(); - } - - /** - * Get the renew property: The renew state of the reservation. - * - * @return the renew value. - */ - public Boolean renew() { - return this.innerProperties() == null ? null : this.innerProperties().renew(); - } - - /** - * Get the renewSource property: The renew source of the reservation. - * - * @return the renewSource value. - */ - public String renewSource() { - return this.innerProperties() == null ? null : this.innerProperties().renewSource(); - } - - /** - * Get the utilization property: Reservation utilization. - * - * @return the utilization value. - */ - public ReservationPropertyUtilization utilization() { - return this.innerProperties() == null ? null : this.innerProperties().utilization(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationProperty.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationProperty.java deleted file mode 100644 index aba361ba61f7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationProperty.java +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.ReservationPropertyUtilization; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The property of reservation object. */ -@Fluent -public final class ReservationProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationProperty.class); - - /* - * The array of applied scopes of a reservation. Will be null if the - * reservation is in Shared scope - */ - @JsonProperty(value = "appliedScopes") - private List appliedScopes; - - /* - * The applied scope type of the reservation. - */ - @JsonProperty(value = "appliedScopeType", access = JsonProperty.Access.WRITE_ONLY) - private String appliedScopeType; - - /* - * The reserved source type of the reservation, e.g. virtual machine. - */ - @JsonProperty(value = "reservedResourceType", access = JsonProperty.Access.WRITE_ONLY) - private String reservedResourceType; - - /* - * The number of the reservation. - */ - @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) - private Float quantity; - - /* - * The provisioning state of the reservation, e.g. Succeeded - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The expiry date of the reservation - */ - @JsonProperty(value = "expiryDate", access = JsonProperty.Access.WRITE_ONLY) - private String expiryDate; - - /* - * The provisioning state of the reservation, e.g. Succeeded - */ - @JsonProperty(value = "provisioningSubState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningSubState; - - /* - * The display name of the reservation - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * The provisioning state of the reservation for display, e.g. Succeeded - */ - @JsonProperty(value = "displayProvisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String displayProvisioningState; - - /* - * The renew state of the reservation for display, e.g. On - */ - @JsonProperty(value = "userFriendlyRenewState", access = JsonProperty.Access.WRITE_ONLY) - private String userFriendlyRenewState; - - /* - * The applied scope type of the reservation for display, e.g. Shared - */ - @JsonProperty(value = "userFriendlyAppliedScopeType", access = JsonProperty.Access.WRITE_ONLY) - private String userFriendlyAppliedScopeType; - - /* - * The effective date time of the reservation - */ - @JsonProperty(value = "effectiveDateTime", access = JsonProperty.Access.WRITE_ONLY) - private String effectiveDateTime; - - /* - * The sku description of the reservation - */ - @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) - private String skuDescription; - - /* - * The term of the reservation, e.g. P1Y - */ - @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) - private String term; - - /* - * The renew state of the reservation - */ - @JsonProperty(value = "renew", access = JsonProperty.Access.WRITE_ONLY) - private Boolean renew; - - /* - * The renew source of the reservation - */ - @JsonProperty(value = "renewSource", access = JsonProperty.Access.WRITE_ONLY) - private String renewSource; - - /* - * Reservation utilization - */ - @JsonProperty(value = "utilization", access = JsonProperty.Access.WRITE_ONLY) - private ReservationPropertyUtilization utilization; - - /** - * Get the appliedScopes property: The array of applied scopes of a reservation. Will be null if the reservation is - * in Shared scope. - * - * @return the appliedScopes value. - */ - public List appliedScopes() { - return this.appliedScopes; - } - - /** - * Set the appliedScopes property: The array of applied scopes of a reservation. Will be null if the reservation is - * in Shared scope. - * - * @param appliedScopes the appliedScopes value to set. - * @return the ReservationProperty object itself. - */ - public ReservationProperty withAppliedScopes(List appliedScopes) { - this.appliedScopes = appliedScopes; - return this; - } - - /** - * Get the appliedScopeType property: The applied scope type of the reservation. - * - * @return the appliedScopeType value. - */ - public String appliedScopeType() { - return this.appliedScopeType; - } - - /** - * Get the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine. - * - * @return the reservedResourceType value. - */ - public String reservedResourceType() { - return this.reservedResourceType; - } - - /** - * Get the quantity property: The number of the reservation. - * - * @return the quantity value. - */ - public Float quantity() { - return this.quantity; - } - - /** - * Get the provisioningState property: The provisioning state of the reservation, e.g. Succeeded. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the expiryDate property: The expiry date of the reservation. - * - * @return the expiryDate value. - */ - public String expiryDate() { - return this.expiryDate; - } - - /** - * Get the provisioningSubState property: The provisioning state of the reservation, e.g. Succeeded. - * - * @return the provisioningSubState value. - */ - public String provisioningSubState() { - return this.provisioningSubState; - } - - /** - * Get the displayName property: The display name of the reservation. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the displayProvisioningState property: The provisioning state of the reservation for display, e.g. Succeeded. - * - * @return the displayProvisioningState value. - */ - public String displayProvisioningState() { - return this.displayProvisioningState; - } - - /** - * Get the userFriendlyRenewState property: The renew state of the reservation for display, e.g. On. - * - * @return the userFriendlyRenewState value. - */ - public String userFriendlyRenewState() { - return this.userFriendlyRenewState; - } - - /** - * Get the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g. - * Shared. - * - * @return the userFriendlyAppliedScopeType value. - */ - public String userFriendlyAppliedScopeType() { - return this.userFriendlyAppliedScopeType; - } - - /** - * Get the effectiveDateTime property: The effective date time of the reservation. - * - * @return the effectiveDateTime value. - */ - public String effectiveDateTime() { - return this.effectiveDateTime; - } - - /** - * Get the skuDescription property: The sku description of the reservation. - * - * @return the skuDescription value. - */ - public String skuDescription() { - return this.skuDescription; - } - - /** - * Get the term property: The term of the reservation, e.g. P1Y. - * - * @return the term value. - */ - public String term() { - return this.term; - } - - /** - * Get the renew property: The renew state of the reservation. - * - * @return the renew value. - */ - public Boolean renew() { - return this.renew; - } - - /** - * Get the renewSource property: The renew source of the reservation. - * - * @return the renewSource value. - */ - public String renewSource() { - return this.renewSource; - } - - /** - * Get the utilization property: Reservation utilization. - * - * @return the utilization value. - */ - public ReservationPropertyUtilization utilization() { - return this.utilization; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (utilization() != null) { - utilization().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionInner.java deleted file mode 100644 index 956a87e6b044..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionInner.java +++ /dev/null @@ -1,413 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A transaction. */ -@Fluent -public final class TransactionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransactionInner.class); - - /* - * The properties of a transaction. - */ - @JsonProperty(value = "properties") - private TransactionProperties innerProperties; - - /** - * Get the innerProperties property: The properties of a transaction. - * - * @return the innerProperties value. - */ - private TransactionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the kind property: The kind of transaction. Options are all or reservation. - * - * @return the kind value. - */ - public TransactionTypeKind kind() { - return this.innerProperties() == null ? null : this.innerProperties().kind(); - } - - /** - * Set the kind property: The kind of transaction. Options are all or reservation. - * - * @param kind the kind value to set. - * @return the TransactionInner object itself. - */ - public TransactionInner withKind(TransactionTypeKind kind) { - if (this.innerProperties() == null) { - this.innerProperties = new TransactionProperties(); - } - this.innerProperties().withKind(kind); - return this; - } - - /** - * Get the date property: The date of transaction. - * - * @return the date value. - */ - public OffsetDateTime date() { - return this.innerProperties() == null ? null : this.innerProperties().date(); - } - - /** - * Get the invoice property: Invoice on which the transaction was billed or 'pending' if the transaction is not - * billed. - * - * @return the invoice value. - */ - public String invoice() { - return this.innerProperties() == null ? null : this.innerProperties().invoice(); - } - - /** - * Get the invoiceId property: The ID of the invoice on which the transaction was billed. This field is only - * applicable for transactions which are billed. - * - * @return the invoiceId value. - */ - public String invoiceId() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceId(); - } - - /** - * Get the orderId property: The order ID of the reservation. The field is only applicable for transaction of kind - * reservation. - * - * @return the orderId value. - */ - public String orderId() { - return this.innerProperties() == null ? null : this.innerProperties().orderId(); - } - - /** - * Get the orderName property: The name of the reservation order. The field is only applicable for transactions of - * kind reservation. - * - * @return the orderName value. - */ - public String orderName() { - return this.innerProperties() == null ? null : this.innerProperties().orderName(); - } - - /** - * Get the productFamily property: The family of the product for which the transaction took place. - * - * @return the productFamily value. - */ - public String productFamily() { - return this.innerProperties() == null ? null : this.innerProperties().productFamily(); - } - - /** - * Get the productTypeId property: The ID of the product type for which the transaction took place. - * - * @return the productTypeId value. - */ - public String productTypeId() { - return this.innerProperties() == null ? null : this.innerProperties().productTypeId(); - } - - /** - * Get the productType property: The type of the product for which the transaction took place. - * - * @return the productType value. - */ - public String productType() { - return this.innerProperties() == null ? null : this.innerProperties().productType(); - } - - /** - * Get the productDescription property: The description of the product for which the transaction took place. - * - * @return the productDescription value. - */ - public String productDescription() { - return this.innerProperties() == null ? null : this.innerProperties().productDescription(); - } - - /** - * Get the transactionType property: The type of transaction. - * - * @return the transactionType value. - */ - public ReservationType transactionType() { - return this.innerProperties() == null ? null : this.innerProperties().transactionType(); - } - - /** - * Set the transactionType property: The type of transaction. - * - * @param transactionType the transactionType value to set. - * @return the TransactionInner object itself. - */ - public TransactionInner withTransactionType(ReservationType transactionType) { - if (this.innerProperties() == null) { - this.innerProperties = new TransactionProperties(); - } - this.innerProperties().withTransactionType(transactionType); - return this; - } - - /** - * Get the transactionAmount property: The charge associated with the transaction. - * - * @return the transactionAmount value. - */ - public Amount transactionAmount() { - return this.innerProperties() == null ? null : this.innerProperties().transactionAmount(); - } - - /** - * Get the quantity property: The quantity purchased in the transaction. - * - * @return the quantity value. - */ - public Integer quantity() { - return this.innerProperties() == null ? null : this.innerProperties().quantity(); - } - - /** - * Get the invoiceSectionId property: The ID of the invoice section which will be billed for the transaction. - * - * @return the invoiceSectionId value. - */ - public String invoiceSectionId() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); - } - - /** - * Get the invoiceSectionDisplayName property: The name of the invoice section which will be billed for the - * transaction. - * - * @return the invoiceSectionDisplayName value. - */ - public String invoiceSectionDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionDisplayName(); - } - - /** - * Get the billingProfileId property: The ID of the billing profile which will be billed for the transaction. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile which will be billed for the - * transaction. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); - } - - /** - * Get the customerId property: The ID of the customer for which the transaction took place. The field is applicable - * only for Microsoft Partner Agreement billing account. - * - * @return the customerId value. - */ - public String customerId() { - return this.innerProperties() == null ? null : this.innerProperties().customerId(); - } - - /** - * Get the customerDisplayName property: The name of the customer for which the transaction took place. The field is - * applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerDisplayName value. - */ - public String customerDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().customerDisplayName(); - } - - /** - * Get the subscriptionId property: The ID of the subscription that was used for the transaction. The field is only - * applicable for transaction of kind reservation. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); - } - - /** - * Get the subscriptionName property: The name of the subscription that was used for the transaction. The field is - * only applicable for transaction of kind reservation. - * - * @return the subscriptionName value. - */ - public String subscriptionName() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionName(); - } - - /** - * Get the azurePlan property: The type of azure plan of the subscription that was used for the transaction. - * - * @return the azurePlan value. - */ - public String azurePlan() { - return this.innerProperties() == null ? null : this.innerProperties().azurePlan(); - } - - /** - * Get the azureCreditApplied property: The amount of any Azure credits automatically applied to this transaction. - * - * @return the azureCreditApplied value. - */ - public Amount azureCreditApplied() { - return this.innerProperties() == null ? null : this.innerProperties().azureCreditApplied(); - } - - /** - * Get the billingCurrency property: The ISO 4217 code for the currency in which this transaction is billed. - * - * @return the billingCurrency value. - */ - public String billingCurrency() { - return this.innerProperties() == null ? null : this.innerProperties().billingCurrency(); - } - - /** - * Get the discount property: The percentage discount, if any, applied to this transaction. - * - * @return the discount value. - */ - public Float discount() { - return this.innerProperties() == null ? null : this.innerProperties().discount(); - } - - /** - * Get the effectivePrice property: The price of the product after applying any discounts. - * - * @return the effectivePrice value. - */ - public Amount effectivePrice() { - return this.innerProperties() == null ? null : this.innerProperties().effectivePrice(); - } - - /** - * Get the exchangeRate property: The exchange rate used to convert charged amount to billing currency, if - * applicable. - * - * @return the exchangeRate value. - */ - public Float exchangeRate() { - return this.innerProperties() == null ? null : this.innerProperties().exchangeRate(); - } - - /** - * Get the marketPrice property: The retail price of the product. - * - * @return the marketPrice value. - */ - public Amount marketPrice() { - return this.innerProperties() == null ? null : this.innerProperties().marketPrice(); - } - - /** - * Get the pricingCurrency property: The ISO 4217 code for the currency in which the product is priced. - * - * @return the pricingCurrency value. - */ - public String pricingCurrency() { - return this.innerProperties() == null ? null : this.innerProperties().pricingCurrency(); - } - - /** - * Get the servicePeriodStartDate property: The date of the purchase of the product, or the start date of the month - * in which usage started. - * - * @return the servicePeriodStartDate value. - */ - public OffsetDateTime servicePeriodStartDate() { - return this.innerProperties() == null ? null : this.innerProperties().servicePeriodStartDate(); - } - - /** - * Get the servicePeriodEndDate property: The end date of the product term, or the end date of the month in which - * usage ended. - * - * @return the servicePeriodEndDate value. - */ - public OffsetDateTime servicePeriodEndDate() { - return this.innerProperties() == null ? null : this.innerProperties().servicePeriodEndDate(); - } - - /** - * Get the subTotal property: The pre-tax charged amount for the transaction. - * - * @return the subTotal value. - */ - public Amount subTotal() { - return this.innerProperties() == null ? null : this.innerProperties().subTotal(); - } - - /** - * Get the tax property: The tax amount applied to the transaction. - * - * @return the tax value. - */ - public Amount tax() { - return this.innerProperties() == null ? null : this.innerProperties().tax(); - } - - /** - * Get the unitOfMeasure property: The unit of measure used to bill for the product. For example, compute services - * are billed per hour. - * - * @return the unitOfMeasure value. - */ - public String unitOfMeasure() { - return this.innerProperties() == null ? null : this.innerProperties().unitOfMeasure(); - } - - /** - * Get the units property: The number of units used for a given product. - * - * @return the units value. - */ - public Float units() { - return this.innerProperties() == null ? null : this.innerProperties().units(); - } - - /** - * Get the unitType property: The description for the unit of measure for a given product. - * - * @return the unitType value. - */ - public String unitType() { - return this.innerProperties() == null ? null : this.innerProperties().unitType(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionProperties.java deleted file mode 100644 index 0a4d16e4815d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionProperties.java +++ /dev/null @@ -1,638 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a transaction. */ -@Fluent -public final class TransactionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransactionProperties.class); - - /* - * The kind of transaction. Options are all or reservation. - */ - @JsonProperty(value = "kind") - private TransactionTypeKind kind; - - /* - * The date of transaction. - */ - @JsonProperty(value = "date", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime date; - - /* - * Invoice on which the transaction was billed or 'pending' if the - * transaction is not billed. - */ - @JsonProperty(value = "invoice", access = JsonProperty.Access.WRITE_ONLY) - private String invoice; - - /* - * The ID of the invoice on which the transaction was billed. This field is - * only applicable for transactions which are billed. - */ - @JsonProperty(value = "invoiceId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceId; - - /* - * The order ID of the reservation. The field is only applicable for - * transaction of kind reservation. - */ - @JsonProperty(value = "orderId", access = JsonProperty.Access.WRITE_ONLY) - private String orderId; - - /* - * The name of the reservation order. The field is only applicable for - * transactions of kind reservation. - */ - @JsonProperty(value = "orderName", access = JsonProperty.Access.WRITE_ONLY) - private String orderName; - - /* - * The family of the product for which the transaction took place. - */ - @JsonProperty(value = "productFamily", access = JsonProperty.Access.WRITE_ONLY) - private String productFamily; - - /* - * The ID of the product type for which the transaction took place. - */ - @JsonProperty(value = "productTypeId", access = JsonProperty.Access.WRITE_ONLY) - private String productTypeId; - - /* - * The type of the product for which the transaction took place. - */ - @JsonProperty(value = "productType", access = JsonProperty.Access.WRITE_ONLY) - private String productType; - - /* - * The description of the product for which the transaction took place. - */ - @JsonProperty(value = "productDescription", access = JsonProperty.Access.WRITE_ONLY) - private String productDescription; - - /* - * The type of transaction. - */ - @JsonProperty(value = "transactionType") - private ReservationType transactionType; - - /* - * The charge associated with the transaction. - */ - @JsonProperty(value = "transactionAmount", access = JsonProperty.Access.WRITE_ONLY) - private Amount transactionAmount; - - /* - * The quantity purchased in the transaction. - */ - @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) - private Integer quantity; - - /* - * The ID of the invoice section which will be billed for the transaction. - */ - @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; - - /* - * The name of the invoice section which will be billed for the - * transaction. - */ - @JsonProperty(value = "invoiceSectionDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionDisplayName; - - /* - * The ID of the billing profile which will be billed for the transaction. - */ - @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * The name of the billing profile which will be billed for the - * transaction. - */ - @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileDisplayName; - - /* - * The ID of the customer for which the transaction took place. The field - * is applicable only for Microsoft Partner Agreement billing account. - */ - @JsonProperty(value = "customerId", access = JsonProperty.Access.WRITE_ONLY) - private String customerId; - - /* - * The name of the customer for which the transaction took place. The field - * is applicable only for Microsoft Partner Agreement billing account. - */ - @JsonProperty(value = "customerDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String customerDisplayName; - - /* - * The ID of the subscription that was used for the transaction. The field - * is only applicable for transaction of kind reservation. - */ - @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; - - /* - * The name of the subscription that was used for the transaction. The - * field is only applicable for transaction of kind reservation. - */ - @JsonProperty(value = "subscriptionName", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionName; - - /* - * The type of azure plan of the subscription that was used for the - * transaction. - */ - @JsonProperty(value = "azurePlan", access = JsonProperty.Access.WRITE_ONLY) - private String azurePlan; - - /* - * The amount of any Azure credits automatically applied to this - * transaction. - */ - @JsonProperty(value = "azureCreditApplied", access = JsonProperty.Access.WRITE_ONLY) - private Amount azureCreditApplied; - - /* - * The ISO 4217 code for the currency in which this transaction is billed. - */ - @JsonProperty(value = "billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - - /* - * The percentage discount, if any, applied to this transaction. - */ - @JsonProperty(value = "discount", access = JsonProperty.Access.WRITE_ONLY) - private Float discount; - - /* - * The price of the product after applying any discounts. - */ - @JsonProperty(value = "effectivePrice", access = JsonProperty.Access.WRITE_ONLY) - private Amount effectivePrice; - - /* - * The exchange rate used to convert charged amount to billing currency, if - * applicable. - */ - @JsonProperty(value = "exchangeRate", access = JsonProperty.Access.WRITE_ONLY) - private Float exchangeRate; - - /* - * The retail price of the product. - */ - @JsonProperty(value = "marketPrice", access = JsonProperty.Access.WRITE_ONLY) - private Amount marketPrice; - - /* - * The ISO 4217 code for the currency in which the product is priced. - */ - @JsonProperty(value = "pricingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String pricingCurrency; - - /* - * The date of the purchase of the product, or the start date of the month - * in which usage started. - */ - @JsonProperty(value = "servicePeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime servicePeriodStartDate; - - /* - * The end date of the product term, or the end date of the month in which - * usage ended. - */ - @JsonProperty(value = "servicePeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime servicePeriodEndDate; - - /* - * The pre-tax charged amount for the transaction. - */ - @JsonProperty(value = "subTotal", access = JsonProperty.Access.WRITE_ONLY) - private Amount subTotal; - - /* - * The tax amount applied to the transaction. - */ - @JsonProperty(value = "tax", access = JsonProperty.Access.WRITE_ONLY) - private Amount tax; - - /* - * The unit of measure used to bill for the product. For example, compute - * services are billed per hour. - */ - @JsonProperty(value = "unitOfMeasure", access = JsonProperty.Access.WRITE_ONLY) - private String unitOfMeasure; - - /* - * The number of units used for a given product. - */ - @JsonProperty(value = "units", access = JsonProperty.Access.WRITE_ONLY) - private Float units; - - /* - * The description for the unit of measure for a given product. - */ - @JsonProperty(value = "unitType", access = JsonProperty.Access.WRITE_ONLY) - private String unitType; - - /** - * Get the kind property: The kind of transaction. Options are all or reservation. - * - * @return the kind value. - */ - public TransactionTypeKind kind() { - return this.kind; - } - - /** - * Set the kind property: The kind of transaction. Options are all or reservation. - * - * @param kind the kind value to set. - * @return the TransactionProperties object itself. - */ - public TransactionProperties withKind(TransactionTypeKind kind) { - this.kind = kind; - return this; - } - - /** - * Get the date property: The date of transaction. - * - * @return the date value. - */ - public OffsetDateTime date() { - return this.date; - } - - /** - * Get the invoice property: Invoice on which the transaction was billed or 'pending' if the transaction is not - * billed. - * - * @return the invoice value. - */ - public String invoice() { - return this.invoice; - } - - /** - * Get the invoiceId property: The ID of the invoice on which the transaction was billed. This field is only - * applicable for transactions which are billed. - * - * @return the invoiceId value. - */ - public String invoiceId() { - return this.invoiceId; - } - - /** - * Get the orderId property: The order ID of the reservation. The field is only applicable for transaction of kind - * reservation. - * - * @return the orderId value. - */ - public String orderId() { - return this.orderId; - } - - /** - * Get the orderName property: The name of the reservation order. The field is only applicable for transactions of - * kind reservation. - * - * @return the orderName value. - */ - public String orderName() { - return this.orderName; - } - - /** - * Get the productFamily property: The family of the product for which the transaction took place. - * - * @return the productFamily value. - */ - public String productFamily() { - return this.productFamily; - } - - /** - * Get the productTypeId property: The ID of the product type for which the transaction took place. - * - * @return the productTypeId value. - */ - public String productTypeId() { - return this.productTypeId; - } - - /** - * Get the productType property: The type of the product for which the transaction took place. - * - * @return the productType value. - */ - public String productType() { - return this.productType; - } - - /** - * Get the productDescription property: The description of the product for which the transaction took place. - * - * @return the productDescription value. - */ - public String productDescription() { - return this.productDescription; - } - - /** - * Get the transactionType property: The type of transaction. - * - * @return the transactionType value. - */ - public ReservationType transactionType() { - return this.transactionType; - } - - /** - * Set the transactionType property: The type of transaction. - * - * @param transactionType the transactionType value to set. - * @return the TransactionProperties object itself. - */ - public TransactionProperties withTransactionType(ReservationType transactionType) { - this.transactionType = transactionType; - return this; - } - - /** - * Get the transactionAmount property: The charge associated with the transaction. - * - * @return the transactionAmount value. - */ - public Amount transactionAmount() { - return this.transactionAmount; - } - - /** - * Get the quantity property: The quantity purchased in the transaction. - * - * @return the quantity value. - */ - public Integer quantity() { - return this.quantity; - } - - /** - * Get the invoiceSectionId property: The ID of the invoice section which will be billed for the transaction. - * - * @return the invoiceSectionId value. - */ - public String invoiceSectionId() { - return this.invoiceSectionId; - } - - /** - * Get the invoiceSectionDisplayName property: The name of the invoice section which will be billed for the - * transaction. - * - * @return the invoiceSectionDisplayName value. - */ - public String invoiceSectionDisplayName() { - return this.invoiceSectionDisplayName; - } - - /** - * Get the billingProfileId property: The ID of the billing profile which will be billed for the transaction. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.billingProfileId; - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile which will be billed for the - * transaction. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; - } - - /** - * Get the customerId property: The ID of the customer for which the transaction took place. The field is applicable - * only for Microsoft Partner Agreement billing account. - * - * @return the customerId value. - */ - public String customerId() { - return this.customerId; - } - - /** - * Get the customerDisplayName property: The name of the customer for which the transaction took place. The field is - * applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerDisplayName value. - */ - public String customerDisplayName() { - return this.customerDisplayName; - } - - /** - * Get the subscriptionId property: The ID of the subscription that was used for the transaction. The field is only - * applicable for transaction of kind reservation. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the subscriptionName property: The name of the subscription that was used for the transaction. The field is - * only applicable for transaction of kind reservation. - * - * @return the subscriptionName value. - */ - public String subscriptionName() { - return this.subscriptionName; - } - - /** - * Get the azurePlan property: The type of azure plan of the subscription that was used for the transaction. - * - * @return the azurePlan value. - */ - public String azurePlan() { - return this.azurePlan; - } - - /** - * Get the azureCreditApplied property: The amount of any Azure credits automatically applied to this transaction. - * - * @return the azureCreditApplied value. - */ - public Amount azureCreditApplied() { - return this.azureCreditApplied; - } - - /** - * Get the billingCurrency property: The ISO 4217 code for the currency in which this transaction is billed. - * - * @return the billingCurrency value. - */ - public String billingCurrency() { - return this.billingCurrency; - } - - /** - * Get the discount property: The percentage discount, if any, applied to this transaction. - * - * @return the discount value. - */ - public Float discount() { - return this.discount; - } - - /** - * Get the effectivePrice property: The price of the product after applying any discounts. - * - * @return the effectivePrice value. - */ - public Amount effectivePrice() { - return this.effectivePrice; - } - - /** - * Get the exchangeRate property: The exchange rate used to convert charged amount to billing currency, if - * applicable. - * - * @return the exchangeRate value. - */ - public Float exchangeRate() { - return this.exchangeRate; - } - - /** - * Get the marketPrice property: The retail price of the product. - * - * @return the marketPrice value. - */ - public Amount marketPrice() { - return this.marketPrice; - } - - /** - * Get the pricingCurrency property: The ISO 4217 code for the currency in which the product is priced. - * - * @return the pricingCurrency value. - */ - public String pricingCurrency() { - return this.pricingCurrency; - } - - /** - * Get the servicePeriodStartDate property: The date of the purchase of the product, or the start date of the month - * in which usage started. - * - * @return the servicePeriodStartDate value. - */ - public OffsetDateTime servicePeriodStartDate() { - return this.servicePeriodStartDate; - } - - /** - * Get the servicePeriodEndDate property: The end date of the product term, or the end date of the month in which - * usage ended. - * - * @return the servicePeriodEndDate value. - */ - public OffsetDateTime servicePeriodEndDate() { - return this.servicePeriodEndDate; - } - - /** - * Get the subTotal property: The pre-tax charged amount for the transaction. - * - * @return the subTotal value. - */ - public Amount subTotal() { - return this.subTotal; - } - - /** - * Get the tax property: The tax amount applied to the transaction. - * - * @return the tax value. - */ - public Amount tax() { - return this.tax; - } - - /** - * Get the unitOfMeasure property: The unit of measure used to bill for the product. For example, compute services - * are billed per hour. - * - * @return the unitOfMeasure value. - */ - public String unitOfMeasure() { - return this.unitOfMeasure; - } - - /** - * Get the units property: The number of units used for a given product. - * - * @return the units value. - */ - public Float units() { - return this.units; - } - - /** - * Get the unitType property: The description for the unit of measure for a given product. - * - * @return the unitType value. - */ - public String unitType() { - return this.unitType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (transactionAmount() != null) { - transactionAmount().validate(); - } - if (azureCreditApplied() != null) { - azureCreditApplied().validate(); - } - if (effectivePrice() != null) { - effectivePrice().validate(); - } - if (marketPrice() != null) { - marketPrice().validate(); - } - if (subTotal() != null) { - subTotal().validate(); - } - if (tax() != null) { - tax().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateAddressResponseInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateAddressResponseInner.java deleted file mode 100644 index fe5e582d9b45..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateAddressResponseInner.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.AddressValidationStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of the address validation. */ -@Fluent -public final class ValidateAddressResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateAddressResponseInner.class); - - /* - * status of the address validation. - */ - @JsonProperty(value = "status") - private AddressValidationStatus status; - - /* - * The list of suggested addresses. - */ - @JsonProperty(value = "suggestedAddresses") - private List suggestedAddresses; - - /* - * Validation error message. - */ - @JsonProperty(value = "validationMessage") - private String validationMessage; - - /** - * Get the status property: status of the address validation. - * - * @return the status value. - */ - public AddressValidationStatus status() { - return this.status; - } - - /** - * Set the status property: status of the address validation. - * - * @param status the status value to set. - * @return the ValidateAddressResponseInner object itself. - */ - public ValidateAddressResponseInner withStatus(AddressValidationStatus status) { - this.status = status; - return this; - } - - /** - * Get the suggestedAddresses property: The list of suggested addresses. - * - * @return the suggestedAddresses value. - */ - public List suggestedAddresses() { - return this.suggestedAddresses; - } - - /** - * Set the suggestedAddresses property: The list of suggested addresses. - * - * @param suggestedAddresses the suggestedAddresses value to set. - * @return the ValidateAddressResponseInner object itself. - */ - public ValidateAddressResponseInner withSuggestedAddresses(List suggestedAddresses) { - this.suggestedAddresses = suggestedAddresses; - return this; - } - - /** - * Get the validationMessage property: Validation error message. - * - * @return the validationMessage value. - */ - public String validationMessage() { - return this.validationMessage; - } - - /** - * Set the validationMessage property: Validation error message. - * - * @param validationMessage the validationMessage value to set. - * @return the ValidateAddressResponseInner object itself. - */ - public ValidateAddressResponseInner withValidationMessage(String validationMessage) { - this.validationMessage = validationMessage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (suggestedAddresses() != null) { - suggestedAddresses().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateProductTransferEligibilityResultInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateProductTransferEligibilityResultInner.java deleted file mode 100644 index ec3a1192692a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateProductTransferEligibilityResultInner.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.ValidateProductTransferEligibilityError; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Result of the product transfer eligibility validation. */ -@Fluent -public final class ValidateProductTransferEligibilityResultInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateProductTransferEligibilityResultInner.class); - - /* - * Specifies whether the transfer is eligible or not. - */ - @JsonProperty(value = "isMoveEligible", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isMoveEligible; - - /* - * Validation error details. - */ - @JsonProperty(value = "errorDetails") - private ValidateProductTransferEligibilityError errorDetails; - - /** - * Get the isMoveEligible property: Specifies whether the transfer is eligible or not. - * - * @return the isMoveEligible value. - */ - public Boolean isMoveEligible() { - return this.isMoveEligible; - } - - /** - * Get the errorDetails property: Validation error details. - * - * @return the errorDetails value. - */ - public ValidateProductTransferEligibilityError errorDetails() { - return this.errorDetails; - } - - /** - * Set the errorDetails property: Validation error details. - * - * @param errorDetails the errorDetails value to set. - * @return the ValidateProductTransferEligibilityResultInner object itself. - */ - public ValidateProductTransferEligibilityResultInner withErrorDetails( - ValidateProductTransferEligibilityError errorDetails) { - this.errorDetails = errorDetails; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (errorDetails() != null) { - errorDetails().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateSubscriptionTransferEligibilityResultInner.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateSubscriptionTransferEligibilityResultInner.java deleted file mode 100644 index 8182afc61f4d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateSubscriptionTransferEligibilityResultInner.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.models.ValidateSubscriptionTransferEligibilityError; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Result of the transfer eligibility validation. */ -@Fluent -public final class ValidateSubscriptionTransferEligibilityResultInner { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateSubscriptionTransferEligibilityResultInner.class); - - /* - * Specifies whether the subscription is eligible to be transferred. - */ - @JsonProperty(value = "isMoveEligible", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isMoveEligible; - - /* - * Validation error details. - */ - @JsonProperty(value = "errorDetails") - private ValidateSubscriptionTransferEligibilityError errorDetails; - - /** - * Get the isMoveEligible property: Specifies whether the subscription is eligible to be transferred. - * - * @return the isMoveEligible value. - */ - public Boolean isMoveEligible() { - return this.isMoveEligible; - } - - /** - * Get the errorDetails property: Validation error details. - * - * @return the errorDetails value. - */ - public ValidateSubscriptionTransferEligibilityError errorDetails() { - return this.errorDetails; - } - - /** - * Set the errorDetails property: Validation error details. - * - * @param errorDetails the errorDetails value to set. - * @return the ValidateSubscriptionTransferEligibilityResultInner object itself. - */ - public ValidateSubscriptionTransferEligibilityResultInner withErrorDetails( - ValidateSubscriptionTransferEligibilityError errorDetails) { - this.errorDetails = errorDetails; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (errorDetails() != null) { - errorDetails().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/package-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/package-info.java deleted file mode 100644 index 21d8afb068da..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the inner data models for BillingManagementClient. Billing client provides access to billing - * resources for Azure subscriptions. - */ -package com.azure.resourcemanager.billing.fluent.models; diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/package-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/package-info.java deleted file mode 100644 index ff6c7f208f6a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the service clients for BillingManagementClient. Billing client provides access to billing - * resources for Azure subscriptions. - */ -package com.azure.resourcemanager.billing.fluent; diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressClientImpl.java deleted file mode 100644 index 1d23f4086199..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressClientImpl.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.AddressClient; -import com.azure.resourcemanager.billing.fluent.models.ValidateAddressResponseInner; -import com.azure.resourcemanager.billing.models.AddressDetails; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AddressClient. */ -public final class AddressClientImpl implements AddressClient { - private final ClientLogger logger = new ClientLogger(AddressClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AddressService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of AddressClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AddressClientImpl(BillingManagementClientImpl client) { - this.service = RestProxy.create(AddressService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientAddress to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface AddressService { - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Billing/validateAddress") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AddressDetails address, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * - * @param address Address details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the address validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync(AddressDetails address) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (address == null) { - return Mono.error(new IllegalArgumentException("Parameter address is required and cannot be null.")); - } else { - address.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validate(this.client.getEndpoint(), apiVersion, address, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * - * @param address Address details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the address validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync( - AddressDetails address, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (address == null) { - return Mono.error(new IllegalArgumentException("Parameter address is required and cannot be null.")); - } else { - address.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.validate(this.client.getEndpoint(), apiVersion, address, accept, context); - } - - /** - * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * - * @param address Address details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the address validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync(AddressDetails address) { - return validateWithResponseAsync(address) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * - * @param address Address details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the address validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateAddressResponseInner validate(AddressDetails address) { - return validateAsync(address).block(); - } - - /** - * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * - * @param address Address details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the address validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateWithResponse(AddressDetails address, Context context) { - return validateWithResponseAsync(address, context).block(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressImpl.java deleted file mode 100644 index 58f50db82564..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.AddressClient; -import com.azure.resourcemanager.billing.fluent.models.ValidateAddressResponseInner; -import com.azure.resourcemanager.billing.models.Address; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.ValidateAddressResponse; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class AddressImpl implements Address { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressImpl.class); - - private final AddressClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public AddressImpl(AddressClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public ValidateAddressResponse validate(AddressDetails address) { - ValidateAddressResponseInner inner = this.serviceClient().validate(address); - if (inner != null) { - return new ValidateAddressResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response validateWithResponse(AddressDetails address, Context context) { - Response inner = this.serviceClient().validateWithResponse(address, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ValidateAddressResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private AddressClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementImpl.java deleted file mode 100644 index e0fd035f1086..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.AgreementInner; -import com.azure.resourcemanager.billing.models.AcceptanceMode; -import com.azure.resourcemanager.billing.models.Agreement; -import com.azure.resourcemanager.billing.models.Category; -import com.azure.resourcemanager.billing.models.Participants; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class AgreementImpl implements Agreement { - private AgreementInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - AgreementImpl(AgreementInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String agreementLink() { - return this.innerModel().agreementLink(); - } - - public Category category() { - return this.innerModel().category(); - } - - public AcceptanceMode acceptanceMode() { - return this.innerModel().acceptanceMode(); - } - - public OffsetDateTime effectiveDate() { - return this.innerModel().effectiveDate(); - } - - public OffsetDateTime expirationDate() { - return this.innerModel().expirationDate(); - } - - public List participants() { - List inner = this.innerModel().participants(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String status() { - return this.innerModel().status(); - } - - public AgreementInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsClientImpl.java deleted file mode 100644 index 3b85f5aa2e14..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsClientImpl.java +++ /dev/null @@ -1,499 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.AgreementsClient; -import com.azure.resourcemanager.billing.fluent.models.AgreementInner; -import com.azure.resourcemanager.billing.models.AgreementListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AgreementsClient. */ -public final class AgreementsClientImpl implements AgreementsClient { - private final ClientLogger logger = new ClientLogger(AgreementsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AgreementsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of AgreementsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AgreementsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(AgreementsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientAgreements to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface AgreementsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/{agreementName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("agreementName") String agreementName, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the participants. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the participants. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccount(this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the participants. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName, String expand) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, expand), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { - final String expand = null; - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, expand), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the participants. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String expand, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, expand, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - final String expand = null; - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, expand)); - } - - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the participants. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountName, String expand, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, expand, context)); - } - - /** - * Gets an agreement by ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. - * @param expand May be used to expand the participants. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agreement by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String agreementName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (agreementName == null) { - return Mono.error(new IllegalArgumentException("Parameter agreementName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - agreementName, - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an agreement by ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. - * @param expand May be used to expand the participants. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agreement by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String agreementName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (agreementName == null) { - return Mono.error(new IllegalArgumentException("Parameter agreementName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, billingAccountName, agreementName, expand, accept, context); - } - - /** - * Gets an agreement by ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. - * @param expand May be used to expand the participants. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agreement by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String agreementName, String expand) { - return getWithResponseAsync(billingAccountName, agreementName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an agreement by ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agreement by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String agreementName) { - final String expand = null; - return getWithResponseAsync(billingAccountName, agreementName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an agreement by ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agreement by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgreementInner get(String billingAccountName, String agreementName) { - final String expand = null; - return getAsync(billingAccountName, agreementName, expand).block(); - } - - /** - * Gets an agreement by ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. - * @param expand May be used to expand the participants. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agreement by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String agreementName, String expand, Context context) { - return getWithResponseAsync(billingAccountName, agreementName, expand, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsImpl.java deleted file mode 100644 index 78fc6f2c2d33..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.AgreementsClient; -import com.azure.resourcemanager.billing.fluent.models.AgreementInner; -import com.azure.resourcemanager.billing.models.Agreement; -import com.azure.resourcemanager.billing.models.Agreements; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class AgreementsImpl implements Agreements { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgreementsImpl.class); - - private final AgreementsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public AgreementsImpl( - AgreementsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new AgreementImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName, String expand, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, expand, context); - return Utils.mapPage(inner, inner1 -> new AgreementImpl(inner1, this.manager())); - } - - public Agreement get(String billingAccountName, String agreementName) { - AgreementInner inner = this.serviceClient().get(billingAccountName, agreementName); - if (inner != null) { - return new AgreementImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String billingAccountName, String agreementName, String expand, Context context) { - Response inner = - this.serviceClient().getWithResponse(billingAccountName, agreementName, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AgreementImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private AgreementsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalanceImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalanceImpl.java deleted file mode 100644 index bc5cb8969612..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalanceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.AvailableBalance; - -public final class AvailableBalanceImpl implements AvailableBalance { - private AvailableBalanceInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - AvailableBalanceImpl( - AvailableBalanceInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Amount amount() { - return this.innerModel().amount(); - } - - public AvailableBalanceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java deleted file mode 100644 index a0f1bf1d0238..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.AvailableBalancesClient; -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AvailableBalancesClient. */ -public final class AvailableBalancesClientImpl implements AvailableBalancesClient { - private final ClientLogger logger = new ClientLogger(AvailableBalancesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final AvailableBalancesService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of AvailableBalancesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AvailableBalancesClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(AvailableBalancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientAvailableBalances to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface AvailableBalancesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/availableBalance/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now to settle - * due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the latest Azure credit balance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String billingProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now to settle - * due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the latest Azure credit balance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String billingProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), billingAccountName, billingProfileName, apiVersion, accept, context); - } - - /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now to settle - * due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the latest Azure credit balance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String billingProfileName) { - return getWithResponseAsync(billingAccountName, billingProfileName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now to settle - * due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the latest Azure credit balance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailableBalanceInner get(String billingAccountName, String billingProfileName) { - return getAsync(billingAccountName, billingProfileName).block(); - } - - /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now to settle - * due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the latest Azure credit balance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String billingProfileName, Context context) { - return getWithResponseAsync(billingAccountName, billingProfileName, context).block(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesImpl.java deleted file mode 100644 index 5bf92689d07a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.AvailableBalancesClient; -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner; -import com.azure.resourcemanager.billing.models.AvailableBalance; -import com.azure.resourcemanager.billing.models.AvailableBalances; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class AvailableBalancesImpl implements AvailableBalances { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableBalancesImpl.class); - - private final AvailableBalancesClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public AvailableBalancesImpl( - AvailableBalancesClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public AvailableBalance get(String billingAccountName, String billingProfileName) { - AvailableBalanceInner inner = this.serviceClient().get(billingAccountName, billingProfileName); - if (inner != null) { - return new AvailableBalanceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String billingAccountName, String billingProfileName, Context context) { - Response inner = - this.serviceClient().getWithResponse(billingAccountName, billingProfileName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AvailableBalanceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private AvailableBalancesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountImpl.java deleted file mode 100644 index 51db3bd097ad..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.BillingAccountInner; -import com.azure.resourcemanager.billing.models.AccountStatus; -import com.azure.resourcemanager.billing.models.AccountType; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.AgreementType; -import com.azure.resourcemanager.billing.models.BillingAccount; -import com.azure.resourcemanager.billing.models.BillingProfilesOnExpand; -import com.azure.resourcemanager.billing.models.Department; -import com.azure.resourcemanager.billing.models.Enrollment; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import java.util.Collections; -import java.util.List; - -public final class BillingAccountImpl implements BillingAccount { - private BillingAccountInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - BillingAccountImpl( - BillingAccountInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public AddressDetails soldTo() { - return this.innerModel().soldTo(); - } - - public AgreementType agreementType() { - return this.innerModel().agreementType(); - } - - public AccountType accountType() { - return this.innerModel().accountType(); - } - - public AccountStatus accountStatus() { - return this.innerModel().accountStatus(); - } - - public BillingProfilesOnExpand billingProfiles() { - return this.innerModel().billingProfiles(); - } - - public Enrollment enrollmentDetails() { - return this.innerModel().enrollmentDetails(); - } - - public List departments() { - List inner = this.innerModel().departments(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List enrollmentAccounts() { - List inner = this.innerModel().enrollmentAccounts(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean hasReadAccess() { - return this.innerModel().hasReadAccess(); - } - - public String notificationEmailAddress() { - return this.innerModel().notificationEmailAddress(); - } - - public BillingAccountInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java deleted file mode 100644 index f139e118ab3b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java +++ /dev/null @@ -1,949 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.BillingAccountsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingAccountInner; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionWithCreateSubPermissionInner; -import com.azure.resourcemanager.billing.models.BillingAccountListResult; -import com.azure.resourcemanager.billing.models.BillingAccountUpdateRequest; -import com.azure.resourcemanager.billing.models.InvoiceSectionListWithCreateSubPermissionResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BillingAccountsClient. */ -public final class BillingAccountsClientImpl implements BillingAccountsClient { - private final ClientLogger logger = new ClientLogger(BillingAccountsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BillingAccountsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of BillingAccountsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BillingAccountsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(BillingAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientBillingAccounts to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface BillingAccountsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @BodyParam("application/json") BillingAccountUpdateRequest parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}" - + "/listInvoiceSectionsWithCreateSubscriptionPermission") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> - listInvoiceSectionsByCreateSubscriptionPermission( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> - listInvoiceSectionsByCreateSubscriptionPermissionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the billing accounts that a user has access to. - * - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, expand, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the billing accounts that a user has access to. - * - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, expand, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the billing accounts that a user has access to. - * - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand) { - return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the billing accounts that a user has access to. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String expand = null; - return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the billing accounts that a user has access to. - * - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(expand, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the billing accounts that a user has access to. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String expand = null; - return new PagedIterable<>(listAsync(expand)); - } - - /** - * Lists the billing accounts that a user has access to. - * - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String expand, Context context) { - return new PagedIterable<>(listAsync(expand, context)); - } - - /** - * Gets a billing account by its ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingAccountName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.get(this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a billing account by its ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context); - } - - /** - * Gets a billing account by its ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String expand) { - return getWithResponseAsync(billingAccountName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a billing account by its ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName) { - final String expand = null; - return getWithResponseAsync(billingAccountName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a billing account by its ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingAccountInner get(String billingAccountName) { - final String expand = null; - return getAsync(billingAccountName, expand).block(); - } - - /** - * Gets a billing account by its ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingAccountName, String expand, Context context) { - return getWithResponseAsync(billingAccountName, expand, context).block(); - } - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String billingAccountName, BillingAccountUpdateRequest parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update(this.client.getEndpoint(), apiVersion, billingAccountName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String billingAccountName, BillingAccountUpdateRequest parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, billingAccountName, parameters, accept, context); - } - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BillingAccountInner> beginUpdateAsync( - String billingAccountName, BillingAccountUpdateRequest parameters) { - Mono>> mono = updateWithResponseAsync(billingAccountName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BillingAccountInner.class, - BillingAccountInner.class, - Context.NONE); - } - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BillingAccountInner> beginUpdateAsync( - String billingAccountName, BillingAccountUpdateRequest parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(billingAccountName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), BillingAccountInner.class, BillingAccountInner.class, context); - } - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingAccountInner> beginUpdate( - String billingAccountName, BillingAccountUpdateRequest parameters) { - return beginUpdateAsync(billingAccountName, parameters).getSyncPoller(); - } - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingAccountInner> beginUpdate( - String billingAccountName, BillingAccountUpdateRequest parameters, Context context) { - return beginUpdateAsync(billingAccountName, parameters, context).getSyncPoller(); - } - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String billingAccountName, BillingAccountUpdateRequest parameters) { - return beginUpdateAsync(billingAccountName, parameters).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String billingAccountName, BillingAccountUpdateRequest parameters, Context context) { - return beginUpdateAsync(billingAccountName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingAccountInner update(String billingAccountName, BillingAccountUpdateRequest parameters) { - return updateAsync(billingAccountName, parameters).block(); - } - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingAccountInner update( - String billingAccountName, BillingAccountUpdateRequest parameters, Context context) { - return updateAsync(billingAccountName, parameters, context).block(); - } - - /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listInvoiceSectionsByCreateSubscriptionPermissionSinglePageAsync(String billingAccountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInvoiceSectionsByCreateSubscriptionPermission( - this.client.getEndpoint(), apiVersion, billingAccountName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listInvoiceSectionsByCreateSubscriptionPermissionSinglePageAsync(String billingAccountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInvoiceSectionsByCreateSubscriptionPermission( - this.client.getEndpoint(), apiVersion, billingAccountName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux - listInvoiceSectionsByCreateSubscriptionPermissionAsync(String billingAccountName) { - return new PagedFlux<>( - () -> listInvoiceSectionsByCreateSubscriptionPermissionSinglePageAsync(billingAccountName), - nextLink -> listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(nextLink)); - } - - /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux - listInvoiceSectionsByCreateSubscriptionPermissionAsync(String billingAccountName, Context context) { - return new PagedFlux<>( - () -> listInvoiceSectionsByCreateSubscriptionPermissionSinglePageAsync(billingAccountName, context), - nextLink -> listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInvoiceSectionsByCreateSubscriptionPermission( - String billingAccountName) { - return new PagedIterable<>(listInvoiceSectionsByCreateSubscriptionPermissionAsync(billingAccountName)); - } - - /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInvoiceSectionsByCreateSubscriptionPermission( - String billingAccountName, Context context) { - return new PagedIterable<>(listInvoiceSectionsByCreateSubscriptionPermissionAsync(billingAccountName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listInvoiceSectionsByCreateSubscriptionPermissionNext( - nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listInvoiceSectionsByCreateSubscriptionPermissionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listInvoiceSectionsByCreateSubscriptionPermissionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsImpl.java deleted file mode 100644 index 399440dc5ead..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingAccountsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingAccountInner; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionWithCreateSubPermissionInner; -import com.azure.resourcemanager.billing.models.BillingAccount; -import com.azure.resourcemanager.billing.models.BillingAccountUpdateRequest; -import com.azure.resourcemanager.billing.models.BillingAccounts; -import com.azure.resourcemanager.billing.models.InvoiceSectionWithCreateSubPermission; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BillingAccountsImpl implements BillingAccounts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingAccountsImpl.class); - - private final BillingAccountsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public BillingAccountsImpl( - BillingAccountsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new BillingAccountImpl(inner1, this.manager())); - } - - public PagedIterable list(String expand, Context context) { - PagedIterable inner = this.serviceClient().list(expand, context); - return Utils.mapPage(inner, inner1 -> new BillingAccountImpl(inner1, this.manager())); - } - - public BillingAccount get(String billingAccountName) { - BillingAccountInner inner = this.serviceClient().get(billingAccountName); - if (inner != null) { - return new BillingAccountImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String billingAccountName, String expand, Context context) { - Response inner = this.serviceClient().getWithResponse(billingAccountName, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingAccountImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingAccount update(String billingAccountName, BillingAccountUpdateRequest parameters) { - BillingAccountInner inner = this.serviceClient().update(billingAccountName, parameters); - if (inner != null) { - return new BillingAccountImpl(inner, this.manager()); - } else { - return null; - } - } - - public BillingAccount update(String billingAccountName, BillingAccountUpdateRequest parameters, Context context) { - BillingAccountInner inner = this.serviceClient().update(billingAccountName, parameters, context); - if (inner != null) { - return new BillingAccountImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listInvoiceSectionsByCreateSubscriptionPermission( - String billingAccountName) { - PagedIterable inner = - this.serviceClient().listInvoiceSectionsByCreateSubscriptionPermission(billingAccountName); - return Utils.mapPage(inner, inner1 -> new InvoiceSectionWithCreateSubPermissionImpl(inner1, this.manager())); - } - - public PagedIterable listInvoiceSectionsByCreateSubscriptionPermission( - String billingAccountName, Context context) { - PagedIterable inner = - this.serviceClient().listInvoiceSectionsByCreateSubscriptionPermission(billingAccountName, context); - return Utils.mapPage(inner, inner1 -> new InvoiceSectionWithCreateSubPermissionImpl(inner1, this.manager())); - } - - private BillingAccountsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java deleted file mode 100644 index 7beeb4a93f47..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the BillingManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {BillingManagementClientImpl.class}) -public final class BillingManagementClientBuilder { - /* - * The ID that uniquely identifies an Azure subscription. - */ - private String subscriptionId; - - /** - * Sets The ID that uniquely identifies an Azure subscription. - * - * @param subscriptionId the subscriptionId value. - * @return the BillingManagementClientBuilder. - */ - public BillingManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the BillingManagementClientBuilder. - */ - public BillingManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the BillingManagementClientBuilder. - */ - public BillingManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the BillingManagementClientBuilder. - */ - public BillingManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the BillingManagementClientBuilder. - */ - public BillingManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the BillingManagementClientBuilder. - */ - public BillingManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of BillingManagementClientImpl with the provided parameters. - * - * @return an instance of BillingManagementClientImpl. - */ - public BillingManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - BillingManagementClientImpl client = - new BillingManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientImpl.java deleted file mode 100644 index 862b1b980852..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientImpl.java +++ /dev/null @@ -1,560 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.billing.fluent.AddressClient; -import com.azure.resourcemanager.billing.fluent.AgreementsClient; -import com.azure.resourcemanager.billing.fluent.AvailableBalancesClient; -import com.azure.resourcemanager.billing.fluent.BillingAccountsClient; -import com.azure.resourcemanager.billing.fluent.BillingManagementClient; -import com.azure.resourcemanager.billing.fluent.BillingPeriodsClient; -import com.azure.resourcemanager.billing.fluent.BillingPermissionsClient; -import com.azure.resourcemanager.billing.fluent.BillingProfilesClient; -import com.azure.resourcemanager.billing.fluent.BillingPropertiesClient; -import com.azure.resourcemanager.billing.fluent.BillingRoleAssignmentsClient; -import com.azure.resourcemanager.billing.fluent.BillingRoleDefinitionsClient; -import com.azure.resourcemanager.billing.fluent.BillingSubscriptionsClient; -import com.azure.resourcemanager.billing.fluent.CustomersClient; -import com.azure.resourcemanager.billing.fluent.EnrollmentAccountsClient; -import com.azure.resourcemanager.billing.fluent.InstructionsClient; -import com.azure.resourcemanager.billing.fluent.InvoiceSectionsClient; -import com.azure.resourcemanager.billing.fluent.InvoicesClient; -import com.azure.resourcemanager.billing.fluent.OperationsClient; -import com.azure.resourcemanager.billing.fluent.PoliciesClient; -import com.azure.resourcemanager.billing.fluent.ProductsClient; -import com.azure.resourcemanager.billing.fluent.ReservationsClient; -import com.azure.resourcemanager.billing.fluent.TransactionsClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.Map; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the BillingManagementClientImpl type. */ -@ServiceClient(builder = BillingManagementClientBuilder.class) -public final class BillingManagementClientImpl implements BillingManagementClient { - private final ClientLogger logger = new ClientLogger(BillingManagementClientImpl.class); - - /** The ID that uniquely identifies an Azure subscription. */ - private final String subscriptionId; - - /** - * Gets The ID that uniquely identifies an Azure subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The BillingAccountsClient object to access its operations. */ - private final BillingAccountsClient billingAccounts; - - /** - * Gets the BillingAccountsClient object to access its operations. - * - * @return the BillingAccountsClient object. - */ - public BillingAccountsClient getBillingAccounts() { - return this.billingAccounts; - } - - /** The AddressClient object to access its operations. */ - private final AddressClient address; - - /** - * Gets the AddressClient object to access its operations. - * - * @return the AddressClient object. - */ - public AddressClient getAddress() { - return this.address; - } - - /** The AvailableBalancesClient object to access its operations. */ - private final AvailableBalancesClient availableBalances; - - /** - * Gets the AvailableBalancesClient object to access its operations. - * - * @return the AvailableBalancesClient object. - */ - public AvailableBalancesClient getAvailableBalances() { - return this.availableBalances; - } - - /** The InstructionsClient object to access its operations. */ - private final InstructionsClient instructions; - - /** - * Gets the InstructionsClient object to access its operations. - * - * @return the InstructionsClient object. - */ - public InstructionsClient getInstructions() { - return this.instructions; - } - - /** The BillingProfilesClient object to access its operations. */ - private final BillingProfilesClient billingProfiles; - - /** - * Gets the BillingProfilesClient object to access its operations. - * - * @return the BillingProfilesClient object. - */ - public BillingProfilesClient getBillingProfiles() { - return this.billingProfiles; - } - - /** The CustomersClient object to access its operations. */ - private final CustomersClient customers; - - /** - * Gets the CustomersClient object to access its operations. - * - * @return the CustomersClient object. - */ - public CustomersClient getCustomers() { - return this.customers; - } - - /** The InvoiceSectionsClient object to access its operations. */ - private final InvoiceSectionsClient invoiceSections; - - /** - * Gets the InvoiceSectionsClient object to access its operations. - * - * @return the InvoiceSectionsClient object. - */ - public InvoiceSectionsClient getInvoiceSections() { - return this.invoiceSections; - } - - /** The BillingPermissionsClient object to access its operations. */ - private final BillingPermissionsClient billingPermissions; - - /** - * Gets the BillingPermissionsClient object to access its operations. - * - * @return the BillingPermissionsClient object. - */ - public BillingPermissionsClient getBillingPermissions() { - return this.billingPermissions; - } - - /** The BillingSubscriptionsClient object to access its operations. */ - private final BillingSubscriptionsClient billingSubscriptions; - - /** - * Gets the BillingSubscriptionsClient object to access its operations. - * - * @return the BillingSubscriptionsClient object. - */ - public BillingSubscriptionsClient getBillingSubscriptions() { - return this.billingSubscriptions; - } - - /** The ProductsClient object to access its operations. */ - private final ProductsClient products; - - /** - * Gets the ProductsClient object to access its operations. - * - * @return the ProductsClient object. - */ - public ProductsClient getProducts() { - return this.products; - } - - /** The InvoicesClient object to access its operations. */ - private final InvoicesClient invoices; - - /** - * Gets the InvoicesClient object to access its operations. - * - * @return the InvoicesClient object. - */ - public InvoicesClient getInvoices() { - return this.invoices; - } - - /** The TransactionsClient object to access its operations. */ - private final TransactionsClient transactions; - - /** - * Gets the TransactionsClient object to access its operations. - * - * @return the TransactionsClient object. - */ - public TransactionsClient getTransactions() { - return this.transactions; - } - - /** The PoliciesClient object to access its operations. */ - private final PoliciesClient policies; - - /** - * Gets the PoliciesClient object to access its operations. - * - * @return the PoliciesClient object. - */ - public PoliciesClient getPolicies() { - return this.policies; - } - - /** The BillingPropertiesClient object to access its operations. */ - private final BillingPropertiesClient billingProperties; - - /** - * Gets the BillingPropertiesClient object to access its operations. - * - * @return the BillingPropertiesClient object. - */ - public BillingPropertiesClient getBillingProperties() { - return this.billingProperties; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The BillingRoleDefinitionsClient object to access its operations. */ - private final BillingRoleDefinitionsClient billingRoleDefinitions; - - /** - * Gets the BillingRoleDefinitionsClient object to access its operations. - * - * @return the BillingRoleDefinitionsClient object. - */ - public BillingRoleDefinitionsClient getBillingRoleDefinitions() { - return this.billingRoleDefinitions; - } - - /** The BillingRoleAssignmentsClient object to access its operations. */ - private final BillingRoleAssignmentsClient billingRoleAssignments; - - /** - * Gets the BillingRoleAssignmentsClient object to access its operations. - * - * @return the BillingRoleAssignmentsClient object. - */ - public BillingRoleAssignmentsClient getBillingRoleAssignments() { - return this.billingRoleAssignments; - } - - /** The AgreementsClient object to access its operations. */ - private final AgreementsClient agreements; - - /** - * Gets the AgreementsClient object to access its operations. - * - * @return the AgreementsClient object. - */ - public AgreementsClient getAgreements() { - return this.agreements; - } - - /** The ReservationsClient object to access its operations. */ - private final ReservationsClient reservations; - - /** - * Gets the ReservationsClient object to access its operations. - * - * @return the ReservationsClient object. - */ - public ReservationsClient getReservations() { - return this.reservations; - } - - /** The EnrollmentAccountsClient object to access its operations. */ - private final EnrollmentAccountsClient enrollmentAccounts; - - /** - * Gets the EnrollmentAccountsClient object to access its operations. - * - * @return the EnrollmentAccountsClient object. - */ - public EnrollmentAccountsClient getEnrollmentAccounts() { - return this.enrollmentAccounts; - } - - /** The BillingPeriodsClient object to access its operations. */ - private final BillingPeriodsClient billingPeriods; - - /** - * Gets the BillingPeriodsClient object to access its operations. - * - * @return the BillingPeriodsClient object. - */ - public BillingPeriodsClient getBillingPeriods() { - return this.billingPeriods; - } - - /** - * Initializes an instance of BillingManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The ID that uniquely identifies an Azure subscription. - * @param endpoint server parameter. - */ - BillingManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.billingAccounts = new BillingAccountsClientImpl(this); - this.address = new AddressClientImpl(this); - this.availableBalances = new AvailableBalancesClientImpl(this); - this.instructions = new InstructionsClientImpl(this); - this.billingProfiles = new BillingProfilesClientImpl(this); - this.customers = new CustomersClientImpl(this); - this.invoiceSections = new InvoiceSectionsClientImpl(this); - this.billingPermissions = new BillingPermissionsClientImpl(this); - this.billingSubscriptions = new BillingSubscriptionsClientImpl(this); - this.products = new ProductsClientImpl(this); - this.invoices = new InvoicesClientImpl(this); - this.transactions = new TransactionsClientImpl(this); - this.policies = new PoliciesClientImpl(this); - this.billingProperties = new BillingPropertiesClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.billingRoleDefinitions = new BillingRoleDefinitionsClientImpl(this); - this.billingRoleAssignments = new BillingRoleAssignmentsClientImpl(this); - this.agreements = new AgreementsClientImpl(this); - this.reservations = new ReservationsClientImpl(this); - this.enrollmentAccounts = new EnrollmentAccountsClientImpl(this); - this.billingPeriods = new BillingPeriodsClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(s); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodImpl.java deleted file mode 100644 index 73818c947611..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; -import com.azure.resourcemanager.billing.models.BillingPeriod; -import java.time.LocalDate; -import java.util.Collections; -import java.util.List; - -public final class BillingPeriodImpl implements BillingPeriod { - private BillingPeriodInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - BillingPeriodImpl(BillingPeriodInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public LocalDate billingPeriodStartDate() { - return this.innerModel().billingPeriodStartDate(); - } - - public LocalDate billingPeriodEndDate() { - return this.innerModel().billingPeriodEndDate(); - } - - public List invoiceIds() { - List inner = this.innerModel().invoiceIds(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public BillingPeriodInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsClientImpl.java deleted file mode 100644 index 41908fdc5d50..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsClientImpl.java +++ /dev/null @@ -1,525 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingPeriodsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; -import com.azure.resourcemanager.billing.models.BillingPeriodsListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BillingPeriodsClient. */ -public final class BillingPeriodsClientImpl implements BillingPeriodsClient { - private final ClientLogger logger = new ClientLogger(BillingPeriodsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BillingPeriodsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of BillingPeriodsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BillingPeriodsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(BillingPeriodsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientBillingPeriods to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface BillingPeriodsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @QueryParam("$skiptoken") String skiptoken, - @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("billingPeriodName") String billingPeriodName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @param filter May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', - * 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String skiptoken, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - filter, - skiptoken, - top, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @param filter May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', - * 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String filter, String skiptoken, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - filter, - skiptoken, - top, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @param filter May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', - * 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String skiptoken, Integer top) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, skiptoken, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - final String skiptoken = null; - final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter, skiptoken, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @param filter May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', - * 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String skiptoken, Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, skiptoken, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final String skiptoken = null; - final Integer top = null; - return new PagedIterable<>(listAsync(filter, skiptoken, top)); - } - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @param filter May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', - * 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, String skiptoken, Integer top, Context context) { - return new PagedIterable<>(listAsync(filter, skiptoken, top, context)); - } - - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types - * which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @param billingPeriodName The name of a BillingPeriod resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingPeriodName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (billingPeriodName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingPeriodName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - billingPeriodName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types - * which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @param billingPeriodName The name of a BillingPeriod resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingPeriodName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (billingPeriodName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingPeriodName is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - billingPeriodName, - accept, - context); - } - - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types - * which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @param billingPeriodName The name of a BillingPeriod resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingPeriodName) { - return getWithResponseAsync(billingPeriodName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types - * which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @param billingPeriodName The name of a BillingPeriod resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingPeriodInner get(String billingPeriodName) { - return getAsync(billingPeriodName).block(); - } - - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types - * which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @param billingPeriodName The name of a BillingPeriod resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingPeriodName, Context context) { - return getWithResponseAsync(billingPeriodName, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsImpl.java deleted file mode 100644 index dce7606151b3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingPeriodsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; -import com.azure.resourcemanager.billing.models.BillingPeriod; -import com.azure.resourcemanager.billing.models.BillingPeriods; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BillingPeriodsImpl implements BillingPeriods { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingPeriodsImpl.class); - - private final BillingPeriodsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public BillingPeriodsImpl( - BillingPeriodsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new BillingPeriodImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, String skiptoken, Integer top, Context context) { - PagedIterable inner = this.serviceClient().list(filter, skiptoken, top, context); - return Utils.mapPage(inner, inner1 -> new BillingPeriodImpl(inner1, this.manager())); - } - - public BillingPeriod get(String billingPeriodName) { - BillingPeriodInner inner = this.serviceClient().get(billingPeriodName); - if (inner != null) { - return new BillingPeriodImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String billingPeriodName, Context context) { - Response inner = this.serviceClient().getWithResponse(billingPeriodName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingPeriodImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private BillingPeriodsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java deleted file mode 100644 index 923d31f7d070..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java +++ /dev/null @@ -1,1113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingPermissionsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.azure.resourcemanager.billing.models.BillingPermissionsListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BillingPermissionsClient. */ -public final class BillingPermissionsClientImpl implements BillingPermissionsClient { - private final ClientLogger logger = new ClientLogger(BillingPermissionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BillingPermissionsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of BillingPermissionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BillingPermissionsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(BillingPermissionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientBillingPermissions to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface BillingPermissionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}" - + "/billingPermissions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomer( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("customerName") String customerName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingPermissions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSections( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingPermissions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSectionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the billing permissions the caller has for a customer. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByCustomer( - this.client.getEndpoint(), apiVersion, billingAccountName, customerName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the billing permissions the caller has for a customer. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCustomer(this.client.getEndpoint(), apiVersion, billingAccountName, customerName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the billing permissions the caller has for a customer. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync( - String billingAccountName, String customerName) { - return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName), - nextLink -> listByCustomerNextSinglePageAsync(nextLink)); - } - - /** - * Lists the billing permissions the caller has for a customer. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync( - String billingAccountName, String customerName, Context context) { - return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName, context), - nextLink -> listByCustomerNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the billing permissions the caller has for a customer. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer( - String billingAccountName, String customerName) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName)); - } - - /** - * Lists the billing permissions the caller has for a customer. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName, context)); - } - - /** - * Lists the billing permissions the caller has on a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the billing permissions the caller has on a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccount(this.client.getEndpoint(), apiVersion, billingAccountName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the billing permissions the caller has on a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the billing permissions the caller has on a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the billing permissions the caller has on a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); - } - - /** - * Lists the billing permissions the caller has on a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountName, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); - } - - /** - * Lists the billing permissions the caller has on an invoice section. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionsSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByInvoiceSections( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the billing permissions the caller has on an invoice section. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionsSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceSections( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the billing permissions the caller has on an invoice section. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionsAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedFlux<>( - () -> listByInvoiceSectionsSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), - nextLink -> listByInvoiceSectionsNextSinglePageAsync(nextLink)); - } - - /** - * Lists the billing permissions the caller has on an invoice section. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionsAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedFlux<>( - () -> - listByInvoiceSectionsSinglePageAsync( - billingAccountName, billingProfileName, invoiceSectionName, context), - nextLink -> listByInvoiceSectionsNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the billing permissions the caller has on an invoice section. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSections( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedIterable<>( - listByInvoiceSectionsAsync(billingAccountName, billingProfileName, invoiceSectionName)); - } - - /** - * Lists the billing permissions the caller has on an invoice section. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSections( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedIterable<>( - listByInvoiceSectionsAsync(billingAccountName, billingProfileName, invoiceSectionName, context)); - } - - /** - * Lists the billing permissions the caller has on a billing profile. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the billing permissions the caller has on a billing profile. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), apiVersion, billingAccountName, billingProfileName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the billing permissions the caller has on a billing profile. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the billing permissions the caller has on a billing profile. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the billing permissions the caller has on a billing profile. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); - } - - /** - * Lists the billing permissions the caller has on a billing profile. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionsNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByInvoiceSectionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceSectionsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsImpl.java deleted file mode 100644 index 513d3ff4b7fc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingPermissionsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.azure.resourcemanager.billing.models.BillingPermissions; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BillingPermissionsImpl implements BillingPermissions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingPermissionsImpl.class); - - private final BillingPermissionsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public BillingPermissionsImpl( - BillingPermissionsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByCustomer(String billingAccountName, String customerName) { - PagedIterable inner = - this.serviceClient().listByCustomer(billingAccountName, customerName); - return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); - } - - public PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context) { - PagedIterable inner = - this.serviceClient().listByCustomer(billingAccountName, customerName, context); - return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount( - String billingAccountName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, context); - return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSections( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - PagedIterable inner = - this.serviceClient().listByInvoiceSections(billingAccountName, billingProfileName, invoiceSectionName); - return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSections( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByInvoiceSections(billingAccountName, billingProfileName, invoiceSectionName, context); - return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); - return Utils.mapPage(inner, inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())); - } - - private BillingPermissionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsPropertiesImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsPropertiesImpl.java deleted file mode 100644 index 3ee1fa7e3ad1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsPropertiesImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.util.Collections; -import java.util.List; - -public final class BillingPermissionsPropertiesImpl implements BillingPermissionsProperties { - private BillingPermissionsPropertiesInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - BillingPermissionsPropertiesImpl( - BillingPermissionsPropertiesInner innerObject, - com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List actions() { - List inner = this.innerModel().actions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List notActions() { - List inner = this.innerModel().notActions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public BillingPermissionsPropertiesInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfileImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfileImpl.java deleted file mode 100644 index ed1966be0269..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfileImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.BillingProfile; -import com.azure.resourcemanager.billing.models.BillingProfileStatus; -import com.azure.resourcemanager.billing.models.BillingRelationshipType; -import com.azure.resourcemanager.billing.models.IndirectRelationshipInfo; -import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpand; -import com.azure.resourcemanager.billing.models.SpendingLimit; -import com.azure.resourcemanager.billing.models.StatusReasonCode; -import com.azure.resourcemanager.billing.models.TargetCloud; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class BillingProfileImpl implements BillingProfile { - private BillingProfileInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - BillingProfileImpl( - BillingProfileInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String poNumber() { - return this.innerModel().poNumber(); - } - - public BillingRelationshipType billingRelationshipType() { - return this.innerModel().billingRelationshipType(); - } - - public AddressDetails billTo() { - return this.innerModel().billTo(); - } - - public IndirectRelationshipInfo indirectRelationshipInfo() { - return this.innerModel().indirectRelationshipInfo(); - } - - public Boolean invoiceEmailOptIn() { - return this.innerModel().invoiceEmailOptIn(); - } - - public Integer invoiceDay() { - return this.innerModel().invoiceDay(); - } - - public String currency() { - return this.innerModel().currency(); - } - - public List enabledAzurePlans() { - List inner = this.innerModel().enabledAzurePlans(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public InvoiceSectionsOnExpand invoiceSections() { - return this.innerModel().invoiceSections(); - } - - public Boolean hasReadAccess() { - return this.innerModel().hasReadAccess(); - } - - public String systemId() { - return this.innerModel().systemId(); - } - - public BillingProfileStatus status() { - return this.innerModel().status(); - } - - public StatusReasonCode statusReasonCode() { - return this.innerModel().statusReasonCode(); - } - - public SpendingLimit spendingLimit() { - return this.innerModel().spendingLimit(); - } - - public List targetClouds() { - List inner = this.innerModel().targetClouds(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public BillingProfileInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java deleted file mode 100644 index 5b0e499c27ed..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java +++ /dev/null @@ -1,802 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.BillingProfilesClient; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; -import com.azure.resourcemanager.billing.models.BillingProfileListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BillingProfilesClient. */ -public final class BillingProfilesClientImpl implements BillingProfilesClient { - private final ClientLogger logger = new ClientLogger(BillingProfilesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BillingProfilesService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of BillingProfilesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BillingProfilesClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(BillingProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientBillingProfiles to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface BillingProfilesService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @BodyParam("application/json") BillingProfileInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the invoice sections. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the invoice sections. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccount(this.client.getEndpoint(), apiVersion, billingAccountName, expand, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the invoice sections. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName, String expand) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, expand), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { - final String expand = null; - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, expand), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the invoice sections. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String expand, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, expand, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - final String expand = null; - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, expand)); - } - - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the invoice sections. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountName, String expand, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, expand, context)); - } - - /** - * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param expand May be used to expand the invoice sections. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String billingProfileName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param expand May be used to expand the invoice sections. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String billingProfileName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), apiVersion, billingAccountName, billingProfileName, expand, accept, context); - } - - /** - * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param expand May be used to expand the invoice sections. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String billingProfileName, String expand) { - return getWithResponseAsync(billingAccountName, billingProfileName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String billingProfileName) { - final String expand = null; - return getWithResponseAsync(billingAccountName, billingProfileName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingProfileInner get(String billingAccountName, String billingProfileName) { - final String expand = null; - return getAsync(billingAccountName, billingProfileName, expand).block(); - } - - /** - * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param expand May be used to expand the invoice sections. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String billingProfileName, String expand, Context context) { - return getWithResponseAsync(billingAccountName, billingProfileName, expand, context).block(); - } - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - parameters, - accept, - context); - } - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BillingProfileInner> beginCreateOrUpdateAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(billingAccountName, billingProfileName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BillingProfileInner.class, - BillingProfileInner.class, - Context.NONE); - } - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BillingProfileInner> beginCreateOrUpdateAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(billingAccountName, billingProfileName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), BillingProfileInner.class, BillingProfileInner.class, context); - } - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingProfileInner> beginCreateOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { - return beginCreateOrUpdateAsync(billingAccountName, billingProfileName, parameters).getSyncPoller(); - } - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingProfileInner> beginCreateOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { - return beginCreateOrUpdateAsync(billingAccountName, billingProfileName, parameters, context).getSyncPoller(); - } - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { - return beginCreateOrUpdateAsync(billingAccountName, billingProfileName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { - return beginCreateOrUpdateAsync(billingAccountName, billingProfileName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingProfileInner createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { - return createOrUpdateAsync(billingAccountName, billingProfileName, parameters).block(); - } - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingProfileInner createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { - return createOrUpdateAsync(billingAccountName, billingProfileName, parameters, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesImpl.java deleted file mode 100644 index dce0bde2fb4c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingProfilesClient; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; -import com.azure.resourcemanager.billing.models.BillingProfile; -import com.azure.resourcemanager.billing.models.BillingProfiles; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BillingProfilesImpl implements BillingProfiles { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingProfilesImpl.class); - - private final BillingProfilesClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public BillingProfilesImpl( - BillingProfilesClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new BillingProfileImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount( - String billingAccountName, String expand, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, expand, context); - return Utils.mapPage(inner, inner1 -> new BillingProfileImpl(inner1, this.manager())); - } - - public BillingProfile get(String billingAccountName, String billingProfileName) { - BillingProfileInner inner = this.serviceClient().get(billingAccountName, billingProfileName); - if (inner != null) { - return new BillingProfileImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String billingAccountName, String billingProfileName, String expand, Context context) { - Response inner = - this.serviceClient().getWithResponse(billingAccountName, billingProfileName, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingProfileImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingProfile createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { - BillingProfileInner inner = - this.serviceClient().createOrUpdate(billingAccountName, billingProfileName, parameters); - if (inner != null) { - return new BillingProfileImpl(inner, this.manager()); - } else { - return null; - } - } - - public BillingProfile createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { - BillingProfileInner inner = - this.serviceClient().createOrUpdate(billingAccountName, billingProfileName, parameters, context); - if (inner != null) { - return new BillingProfileImpl(inner, this.manager()); - } else { - return null; - } - } - - private BillingProfilesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesClientImpl.java deleted file mode 100644 index ad67ab0e5b5b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesClientImpl.java +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingPropertiesClient; -import com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BillingPropertiesClient. */ -public final class BillingPropertiesClientImpl implements BillingPropertiesClient { - private final ClientLogger logger = new ClientLogger(BillingPropertiesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BillingPropertiesService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of BillingPropertiesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BillingPropertiesClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(BillingPropertiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientBillingProperties to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface BillingPropertiesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BillingPropertyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts with - * agreement type Enterprise Agreement. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the billing properties for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts with - * agreement type Enterprise Agreement. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the billing properties for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context); - } - - /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts with - * agreement type Enterprise Agreement. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the billing properties for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync() { - return getWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts with - * agreement type Enterprise Agreement. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the billing properties for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingPropertyInner get() { - return getAsync().block(); - } - - /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts with - * agreement type Enterprise Agreement. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the billing properties for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(Context context) { - return getWithResponseAsync(context).block(); - } - - /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported - * only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param parameters Request parameters that are provided to the update billing property operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing property. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(BillingPropertyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported - * only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param parameters Request parameters that are provided to the update billing property operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing property. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - BillingPropertyInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, parameters, accept, context); - } - - /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported - * only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param parameters Request parameters that are provided to the update billing property operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing property. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(BillingPropertyInner parameters) { - return updateWithResponseAsync(parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported - * only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param parameters Request parameters that are provided to the update billing property operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing property. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingPropertyInner update(BillingPropertyInner parameters) { - return updateAsync(parameters).block(); - } - - /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported - * only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param parameters Request parameters that are provided to the update billing property operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing property. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(BillingPropertyInner parameters, Context context) { - return updateWithResponseAsync(parameters, context).block(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesImpl.java deleted file mode 100644 index b60d1b534773..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingPropertiesClient; -import com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner; -import com.azure.resourcemanager.billing.models.BillingProperties; -import com.azure.resourcemanager.billing.models.BillingProperty; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BillingPropertiesImpl implements BillingProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingPropertiesImpl.class); - - private final BillingPropertiesClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public BillingPropertiesImpl( - BillingPropertiesClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public BillingProperty get() { - BillingPropertyInner inner = this.serviceClient().get(); - if (inner != null) { - return new BillingPropertyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(Context context) { - Response inner = this.serviceClient().getWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingPropertyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingProperty update(BillingPropertyInner parameters) { - BillingPropertyInner inner = this.serviceClient().update(parameters); - if (inner != null) { - return new BillingPropertyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(BillingPropertyInner parameters, Context context) { - Response inner = this.serviceClient().updateWithResponse(parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingPropertyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private BillingPropertiesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertyImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertyImpl.java deleted file mode 100644 index 2b7e9f77c294..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertyImpl.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner; -import com.azure.resourcemanager.billing.models.BillingProfileSpendingLimit; -import com.azure.resourcemanager.billing.models.BillingProfileStatus; -import com.azure.resourcemanager.billing.models.BillingProfileStatusReasonCode; -import com.azure.resourcemanager.billing.models.BillingProperty; - -public final class BillingPropertyImpl implements BillingProperty { - private BillingPropertyInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - BillingPropertyImpl( - BillingPropertyInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String accountAdminNotificationEmailAddress() { - return this.innerModel().accountAdminNotificationEmailAddress(); - } - - public String billingTenantId() { - return this.innerModel().billingTenantId(); - } - - public String billingAccountId() { - return this.innerModel().billingAccountId(); - } - - public String billingAccountDisplayName() { - return this.innerModel().billingAccountDisplayName(); - } - - public String billingProfileId() { - return this.innerModel().billingProfileId(); - } - - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); - } - - public BillingProfileStatus billingProfileStatus() { - return this.innerModel().billingProfileStatus(); - } - - public BillingProfileStatusReasonCode billingProfileStatusReasonCode() { - return this.innerModel().billingProfileStatusReasonCode(); - } - - public BillingProfileSpendingLimit billingProfileSpendingLimit() { - return this.innerModel().billingProfileSpendingLimit(); - } - - public String costCenter() { - return this.innerModel().costCenter(); - } - - public String invoiceSectionId() { - return this.innerModel().invoiceSectionId(); - } - - public String invoiceSectionDisplayName() { - return this.innerModel().invoiceSectionDisplayName(); - } - - public Boolean isAccountAdmin() { - return this.innerModel().isAccountAdmin(); - } - - public String productId() { - return this.innerModel().productId(); - } - - public String productName() { - return this.innerModel().productName(); - } - - public String skuId() { - return this.innerModel().skuId(); - } - - public String skuDescription() { - return this.innerModel().skuDescription(); - } - - public BillingPropertyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentImpl.java deleted file mode 100644 index ad7683a97484..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; - -public final class BillingRoleAssignmentImpl implements BillingRoleAssignment { - private BillingRoleAssignmentInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - BillingRoleAssignmentImpl( - BillingRoleAssignmentInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String createdOn() { - return this.innerModel().createdOn(); - } - - public String createdByPrincipalTenantId() { - return this.innerModel().createdByPrincipalTenantId(); - } - - public String createdByPrincipalId() { - return this.innerModel().createdByPrincipalId(); - } - - public String createdByUserEmailAddress() { - return this.innerModel().createdByUserEmailAddress(); - } - - public String principalId() { - return this.innerModel().principalId(); - } - - public String principalTenantId() { - return this.innerModel().principalTenantId(); - } - - public String roleDefinitionId() { - return this.innerModel().roleDefinitionId(); - } - - public String scope() { - return this.innerModel().scope(); - } - - public String userAuthenticationType() { - return this.innerModel().userAuthenticationType(); - } - - public String userEmailAddress() { - return this.innerModel().userEmailAddress(); - } - - public BillingRoleAssignmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java deleted file mode 100644 index 9940fb97457e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java +++ /dev/null @@ -1,1992 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingRoleAssignmentsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; -import com.azure.resourcemanager.billing.models.BillingRoleAssignmentListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BillingRoleAssignmentsClient. */ -public final class BillingRoleAssignmentsClientImpl implements BillingRoleAssignmentsClient { - private final ClientLogger logger = new ClientLogger(BillingRoleAssignmentsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BillingRoleAssignmentsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of BillingRoleAssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BillingRoleAssignmentsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy - .create(BillingRoleAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientBillingRoleAssignments to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface BillingRoleAssignmentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments" - + "/{billingRoleAssignmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments" - + "/{billingRoleAssignmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByInvoiceSection( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, - @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByInvoiceSection( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, - @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleAssignments/{billingRoleAssignmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleAssignments/{billingRoleAssignmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("billingRoleAssignmentName") String billingRoleAssignmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSection( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSectionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByBillingAccount( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingRoleAssignmentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, billingRoleAssignmentName, accept, context); - } - - /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingAccountAsync( - String billingAccountName, String billingRoleAssignmentName) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner getByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { - return getByBillingAccountAsync(billingAccountName, billingRoleAssignmentName).block(); - } - - /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName, context).block(); - } - - /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteByBillingAccount( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingRoleAssignmentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, billingRoleAssignmentName, accept, context); - } - - /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByBillingAccountAsync( - String billingAccountName, String billingRoleAssignmentName) { - return deleteByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner deleteByBillingAccount( - String billingAccountName, String billingRoleAssignmentName) { - return deleteByBillingAccountAsync(billingAccountName, billingRoleAssignmentName).block(); - } - - /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context) { - return deleteByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName, context).block(); - } - - /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleAssignmentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleAssignmentName, - accept, - context); - } - - /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - return getByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - return getByInvoiceSectionAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) - .block(); - } - - /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context) { - return getByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, context) - .block(); - } - - /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleAssignmentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleAssignmentName, - accept, - context); - } - - /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - return deleteByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner deleteByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - return deleteByInvoiceSectionAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) - .block(); - } - - /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context) { - return deleteByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, context) - .block(); - } - - /** - * Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - billingRoleAssignmentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - billingRoleAssignmentName, - accept, - context); - } - - /** - * Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingProfileAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, billingRoleAssignmentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return getByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).block(); - } - - /** - * Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { - return getByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, billingRoleAssignmentName, context) - .block(); - } - - /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - billingRoleAssignmentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (billingRoleAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - billingRoleAssignmentName, - accept, - context); - } - - /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByBillingProfileAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return deleteByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, billingRoleAssignmentName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleAssignmentInner deleteByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return deleteByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).block(); - } - - /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { - return deleteByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, billingRoleAssignmentName, context) - .block(); - } - - /** - * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccount(this.client.getEndpoint(), apiVersion, billingAccountName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); - } - - /** - * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); - } - - /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedFlux<>( - () -> listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); - } - - /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync( - billingAccountName, billingProfileName, invoiceSectionName, context), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName)); - } - - /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, context)); - } - - /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), apiVersion, billingAccountName, billingProfileName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); - } - - /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsImpl.java deleted file mode 100644 index 58062de8c9a4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsImpl.java +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingRoleAssignmentsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import com.azure.resourcemanager.billing.models.BillingRoleAssignments; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BillingRoleAssignmentsImpl implements BillingRoleAssignments { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingRoleAssignmentsImpl.class); - - private final BillingRoleAssignmentsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public BillingRoleAssignmentsImpl( - BillingRoleAssignmentsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public BillingRoleAssignment getByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { - BillingRoleAssignmentInner inner = - this.serviceClient().getByBillingAccount(billingAccountName, billingRoleAssignmentName); - if (inner != null) { - return new BillingRoleAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context) { - Response inner = - this - .serviceClient() - .getByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingRoleAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingRoleAssignment deleteByBillingAccount(String billingAccountName, String billingRoleAssignmentName) { - BillingRoleAssignmentInner inner = - this.serviceClient().deleteByBillingAccount(billingAccountName, billingRoleAssignmentName); - if (inner != null) { - return new BillingRoleAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context) { - Response inner = - this - .serviceClient() - .deleteByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingRoleAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingRoleAssignment getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - BillingRoleAssignmentInner inner = - this - .serviceClient() - .getByInvoiceSection( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName); - if (inner != null) { - return new BillingRoleAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context) { - Response inner = - this - .serviceClient() - .getByInvoiceSectionWithResponse( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingRoleAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingRoleAssignment deleteByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - BillingRoleAssignmentInner inner = - this - .serviceClient() - .deleteByInvoiceSection( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName); - if (inner != null) { - return new BillingRoleAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context) { - Response inner = - this - .serviceClient() - .deleteByInvoiceSectionWithResponse( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingRoleAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingRoleAssignment getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - BillingRoleAssignmentInner inner = - this.serviceClient().getByBillingProfile(billingAccountName, billingProfileName, billingRoleAssignmentName); - if (inner != null) { - return new BillingRoleAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { - Response inner = - this - .serviceClient() - .getByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleAssignmentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingRoleAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingRoleAssignment deleteByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - BillingRoleAssignmentInner inner = - this - .serviceClient() - .deleteByBillingProfile(billingAccountName, billingProfileName, billingRoleAssignmentName); - if (inner != null) { - return new BillingRoleAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { - Response inner = - this - .serviceClient() - .deleteByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleAssignmentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingRoleAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - PagedIterable inner = - this.serviceClient().listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleAssignmentImpl(inner1, this.manager())); - } - - private BillingRoleAssignmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionImpl.java deleted file mode 100644 index 76faed4c2ee1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class BillingRoleDefinitionImpl implements BillingRoleDefinition { - private BillingRoleDefinitionInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - BillingRoleDefinitionImpl( - BillingRoleDefinitionInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String description() { - return this.innerModel().description(); - } - - public List permissions() { - List inner = this.innerModel().permissions(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new BillingPermissionsPropertiesImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String roleName() { - return this.innerModel().roleName(); - } - - public BillingRoleDefinitionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java deleted file mode 100644 index 52d2e1f966c9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java +++ /dev/null @@ -1,1431 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingRoleDefinitionsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; -import com.azure.resourcemanager.billing.models.BillingRoleDefinitionListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BillingRoleDefinitionsClient. */ -public final class BillingRoleDefinitionsClientImpl implements BillingRoleDefinitionsClient { - private final ClientLogger logger = new ClientLogger(BillingRoleDefinitionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BillingRoleDefinitionsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of BillingRoleDefinitionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BillingRoleDefinitionsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy - .create(BillingRoleDefinitionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientBillingRoleDefinitions to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface BillingRoleDefinitionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions" - + "/{billingRoleDefinitionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingRoleDefinitionName") String billingRoleDefinitionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByInvoiceSection( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, - @PathParam("billingRoleDefinitionName") String billingRoleDefinitionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleDefinitions/{billingRoleDefinitionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("billingRoleDefinitionName") String billingRoleDefinitionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSection( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSectionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleDefinitionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingRoleDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByBillingAccount( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingRoleDefinitionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingAccountWithResponseAsync( - String billingAccountName, String billingRoleDefinitionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingRoleDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, billingRoleDefinitionName, accept, context); - } - - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingAccountAsync( - String billingAccountName, String billingRoleDefinitionName) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleDefinitionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleDefinitionInner getByBillingAccount(String billingAccountName, String billingRoleDefinitionName) { - return getByBillingAccountAsync(billingAccountName, billingRoleDefinitionName).block(); - } - - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleDefinitionName, Context context) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleDefinitionName, context).block(); - } - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - if (billingRoleDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleDefinitionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByInvoiceSectionWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - if (billingRoleDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - billingRoleDefinitionName, - accept, - context); - } - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName) { - return getByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleDefinitionInner getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName) { - return getByInvoiceSectionAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName) - .block(); - } - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName, - Context context) { - return getByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName, context) - .block(); - } - - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (billingRoleDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - billingRoleDefinitionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (billingRoleDefinitionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter billingRoleDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - billingRoleDefinitionName, - accept, - context); - } - - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingProfileAsync( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { - return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, billingRoleDefinitionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingRoleDefinitionInner getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { - return getByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleDefinitionName).block(); - } - - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context) { - return getByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, billingRoleDefinitionName, context) - .block(); - } - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccount(this.client.getEndpoint(), apiVersion, billingAccountName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); - } - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); - } - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceSection( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedFlux<>( - () -> listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); - } - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync( - billingAccountName, billingProfileName, invoiceSectionName, context), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName)); - } - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, context)); - } - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), apiVersion, billingAccountName, billingProfileName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); - } - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsImpl.java deleted file mode 100644 index 04e129c7d9b6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsImpl.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingRoleDefinitionsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import com.azure.resourcemanager.billing.models.BillingRoleDefinitions; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BillingRoleDefinitionsImpl implements BillingRoleDefinitions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingRoleDefinitionsImpl.class); - - private final BillingRoleDefinitionsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public BillingRoleDefinitionsImpl( - BillingRoleDefinitionsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public BillingRoleDefinition getByBillingAccount(String billingAccountName, String billingRoleDefinitionName) { - BillingRoleDefinitionInner inner = - this.serviceClient().getByBillingAccount(billingAccountName, billingRoleDefinitionName); - if (inner != null) { - return new BillingRoleDefinitionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleDefinitionName, Context context) { - Response inner = - this - .serviceClient() - .getByBillingAccountWithResponse(billingAccountName, billingRoleDefinitionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingRoleDefinitionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingRoleDefinition getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName) { - BillingRoleDefinitionInner inner = - this - .serviceClient() - .getByInvoiceSection( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName); - if (inner != null) { - return new BillingRoleDefinitionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName, - Context context) { - Response inner = - this - .serviceClient() - .getByInvoiceSectionWithResponse( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingRoleDefinitionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingRoleDefinition getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { - BillingRoleDefinitionInner inner = - this.serviceClient().getByBillingProfile(billingAccountName, billingProfileName, billingRoleDefinitionName); - if (inner != null) { - return new BillingRoleDefinitionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context) { - Response inner = - this - .serviceClient() - .getByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleDefinitionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingRoleDefinitionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - PagedIterable inner = - this.serviceClient().listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); - return Utils.mapPage(inner, inner1 -> new BillingRoleDefinitionImpl(inner1, this.manager())); - } - - private BillingRoleDefinitionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionImpl.java deleted file mode 100644 index 4c0829954277..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionImpl.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import com.azure.resourcemanager.billing.models.Reseller; -import java.util.Collections; -import java.util.List; -import java.util.UUID; - -public final class BillingSubscriptionImpl implements BillingSubscription { - private BillingSubscriptionInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - BillingSubscriptionImpl( - BillingSubscriptionInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public UUID subscriptionId() { - return this.innerModel().subscriptionId(); - } - - public BillingSubscriptionStatusType subscriptionBillingStatus() { - return this.innerModel().subscriptionBillingStatus(); - } - - public Amount lastMonthCharges() { - return this.innerModel().lastMonthCharges(); - } - - public Amount monthToDateCharges() { - return this.innerModel().monthToDateCharges(); - } - - public String billingProfileId() { - return this.innerModel().billingProfileId(); - } - - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); - } - - public String costCenter() { - return this.innerModel().costCenter(); - } - - public String customerId() { - return this.innerModel().customerId(); - } - - public String customerDisplayName() { - return this.innerModel().customerDisplayName(); - } - - public String invoiceSectionId() { - return this.innerModel().invoiceSectionId(); - } - - public String invoiceSectionDisplayName() { - return this.innerModel().invoiceSectionDisplayName(); - } - - public Reseller reseller() { - return this.innerModel().reseller(); - } - - public String skuId() { - return this.innerModel().skuId(); - } - - public String skuDescription() { - return this.innerModel().skuDescription(); - } - - public List suspensionReasons() { - List inner = this.innerModel().suspensionReasons(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public BillingSubscriptionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java deleted file mode 100644 index 93a193a3e84f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java +++ /dev/null @@ -1,1930 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.BillingSubscriptionsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.azure.resourcemanager.billing.fluent.models.ValidateSubscriptionTransferEligibilityResultInner; -import com.azure.resourcemanager.billing.models.BillingSubscriptionsListResult; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in BillingSubscriptionsClient. */ -public final class BillingSubscriptionsClientImpl implements BillingSubscriptionsClient { - private final ClientLogger logger = new ClientLogger(BillingSubscriptionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final BillingSubscriptionsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of BillingSubscriptionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BillingSubscriptionsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy - .create(BillingSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientBillingSubscriptions to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface BillingSubscriptionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}" - + "/billingSubscriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomer( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("customerName") String customerName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingSubscriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingSubscriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSection( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BillingSubscriptionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}" - + "/move") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> move( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TransferBillingSubscriptionRequestProperties parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}" - + "/validateMoveEligibility") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validateMove( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TransferBillingSubscriptionRequestProperties parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSectionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByCustomer( - this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCustomer(this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync(String billingAccountName, String customerName) { - return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName), - nextLink -> listByCustomerNextSinglePageAsync(nextLink)); - } - - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync( - String billingAccountName, String customerName, Context context) { - return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName, context), - nextLink -> listByCustomerNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer(String billingAccountName, String customerName) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName)); - } - - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName, context)); - } - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), billingAccountName, apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccount(this.client.getEndpoint(), billingAccountName, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName)); - } - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, context)); - } - - /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), billingAccountName, billingProfileName, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); - } - - /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); - } - - /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByInvoiceSection( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - invoiceSectionName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceSection( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - invoiceSectionName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedFlux<>( - () -> listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); - } - - /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync( - billingAccountName, billingProfileName, invoiceSectionName, context), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName)); - } - - /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, context)); - } - - /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement and Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a subscription by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingAccountName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - billingAccountName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement and Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a subscription by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingAccountName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - billingAccountName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context); - } - - /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement and Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a subscription by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName) { - return getWithResponseAsync(billingAccountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement and Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a subscription by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingSubscriptionInner get(String billingAccountName) { - return getAsync(billingAccountName).block(); - } - - /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement and Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a subscription by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingAccountName, Context context) { - return getWithResponseAsync(billingAccountName, context).block(); - } - - /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String billingAccountName, BillingSubscriptionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - billingAccountName, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String billingAccountName, BillingSubscriptionInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - billingAccountName, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context); - } - - /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String billingAccountName, BillingSubscriptionInner parameters) { - return updateWithResponseAsync(billingAccountName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingSubscriptionInner update(String billingAccountName, BillingSubscriptionInner parameters) { - return updateAsync(billingAccountName, parameters).block(); - } - - /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, Context context) { - return updateWithResponseAsync(billingAccountName, parameters, context).block(); - } - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> moveWithResponseAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .move( - this.client.getEndpoint(), - billingAccountName, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> moveWithResponseAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .move( - this.client.getEndpoint(), - billingAccountName, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context); - } - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BillingSubscriptionInner> beginMoveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - Mono>> mono = moveWithResponseAsync(billingAccountName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BillingSubscriptionInner.class, - BillingSubscriptionInner.class, - Context.NONE); - } - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BillingSubscriptionInner> beginMoveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = moveWithResponseAsync(billingAccountName, parameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - BillingSubscriptionInner.class, - BillingSubscriptionInner.class, - context); - } - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingSubscriptionInner> beginMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return beginMoveAsync(billingAccountName, parameters).getSyncPoller(); - } - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingSubscriptionInner> beginMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - return beginMoveAsync(billingAccountName, parameters, context).getSyncPoller(); - } - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono moveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return beginMoveAsync(billingAccountName, parameters).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono moveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - return beginMoveAsync(billingAccountName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingSubscriptionInner move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return moveAsync(billingAccountName, parameters).block(); - } - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BillingSubscriptionInner move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - return moveAsync(billingAccountName, parameters, context).block(); - } - - /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateMoveWithResponseAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validateMove( - this.client.getEndpoint(), - billingAccountName, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateMoveWithResponseAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validateMove( - this.client.getEndpoint(), - billingAccountName, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context); - } - - /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateMoveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return validateMoveWithResponseAsync(billingAccountName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateSubscriptionTransferEligibilityResultInner validateMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return validateMoveAsync(billingAccountName, parameters).block(); - } - - /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateMoveWithResponse( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - return validateMoveWithResponseAsync(billingAccountName, parameters, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsImpl.java deleted file mode 100644 index 27b5d567d52b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.BillingSubscriptionsClient; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.azure.resourcemanager.billing.fluent.models.ValidateSubscriptionTransferEligibilityResultInner; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptions; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; -import com.azure.resourcemanager.billing.models.ValidateSubscriptionTransferEligibilityResult; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class BillingSubscriptionsImpl implements BillingSubscriptions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingSubscriptionsImpl.class); - - private final BillingSubscriptionsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public BillingSubscriptionsImpl( - BillingSubscriptionsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByCustomer(String billingAccountName, String customerName) { - PagedIterable inner = - this.serviceClient().listByCustomer(billingAccountName, customerName); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context) { - PagedIterable inner = - this.serviceClient().listByCustomer(billingAccountName, customerName, context); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, context); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - PagedIterable inner = - this.serviceClient().listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, context); - return Utils.mapPage(inner, inner1 -> new BillingSubscriptionImpl(inner1, this.manager())); - } - - public BillingSubscription get(String billingAccountName) { - BillingSubscriptionInner inner = this.serviceClient().get(billingAccountName); - if (inner != null) { - return new BillingSubscriptionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String billingAccountName, Context context) { - Response inner = this.serviceClient().getWithResponse(billingAccountName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingSubscriptionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingSubscription update(String billingAccountName, BillingSubscriptionInner parameters) { - BillingSubscriptionInner inner = this.serviceClient().update(billingAccountName, parameters); - if (inner != null) { - return new BillingSubscriptionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, Context context) { - Response inner = - this.serviceClient().updateWithResponse(billingAccountName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BillingSubscriptionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public BillingSubscription move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - BillingSubscriptionInner inner = this.serviceClient().move(billingAccountName, parameters); - if (inner != null) { - return new BillingSubscriptionImpl(inner, this.manager()); - } else { - return null; - } - } - - public BillingSubscription move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - BillingSubscriptionInner inner = this.serviceClient().move(billingAccountName, parameters, context); - if (inner != null) { - return new BillingSubscriptionImpl(inner, this.manager()); - } else { - return null; - } - } - - public ValidateSubscriptionTransferEligibilityResult validateMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - ValidateSubscriptionTransferEligibilityResultInner inner = - this.serviceClient().validateMove(billingAccountName, parameters); - if (inner != null) { - return new ValidateSubscriptionTransferEligibilityResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response validateMoveWithResponse( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - Response inner = - this.serviceClient().validateMoveWithResponse(billingAccountName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ValidateSubscriptionTransferEligibilityResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private BillingSubscriptionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerImpl.java deleted file mode 100644 index 666146064b57..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.CustomerInner; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Customer; -import com.azure.resourcemanager.billing.models.Reseller; -import java.util.Collections; -import java.util.List; - -public final class CustomerImpl implements Customer { - private CustomerInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - CustomerImpl(CustomerInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String billingProfileId() { - return this.innerModel().billingProfileId(); - } - - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public List enabledAzurePlans() { - List inner = this.innerModel().enabledAzurePlans(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List resellers() { - List inner = this.innerModel().resellers(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public CustomerInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerPolicyImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerPolicyImpl.java deleted file mode 100644 index ab8405cf3917..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomerPolicyImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.models.CustomerPolicy; -import com.azure.resourcemanager.billing.models.ViewCharges; - -public final class CustomerPolicyImpl implements CustomerPolicy { - private CustomerPolicyInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - CustomerPolicyImpl( - CustomerPolicyInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ViewCharges viewCharges() { - return this.innerModel().viewCharges(); - } - - public CustomerPolicyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java deleted file mode 100644 index 970999ba3929..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java +++ /dev/null @@ -1,845 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.CustomersClient; -import com.azure.resourcemanager.billing.fluent.models.CustomerInner; -import com.azure.resourcemanager.billing.models.CustomerListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CustomersClient. */ -public final class CustomersClientImpl implements CustomersClient { - private final ClientLogger logger = new ClientLogger(CustomersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final CustomersService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of CustomersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CustomersClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(CustomersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientCustomers to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface CustomersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/customers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @QueryParam("$search") String search, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @QueryParam("$search") String search, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("customerName") String customerName, - @QueryParam("$expand") String expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, String search, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - search, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, String search, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - search, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, String search, String filter) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, search, filter), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync(String billingAccountName, String billingProfileName) { - final String search = null; - final String filter = null; - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, search, filter), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, String search, String filter, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, search, filter, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - final String search = null; - final String filter = null; - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, search, filter)); - } - - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String search, String filter, Context context) { - return new PagedIterable<>( - listByBillingProfileAsync(billingAccountName, billingProfileName, search, filter, context)); - } - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String search, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, search, filter, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String search, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccount( - this.client.getEndpoint(), apiVersion, billingAccountName, search, filter, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String search, String filter) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, search, filter), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { - final String search = null; - final String filter = null; - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, search, filter), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String search, String filter, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, search, filter, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - final String search = null; - final String filter = null; - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, search, filter)); - } - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountName, String search, String filter, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, search, filter, context)); - } - - /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft - * Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param expand May be used to expand enabledAzurePlans and resellers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a customer by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String customerName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - customerName, - expand, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft - * Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param expand May be used to expand enabledAzurePlans and resellers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a customer by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String customerName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, billingAccountName, customerName, expand, accept, context); - } - - /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft - * Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param expand May be used to expand enabledAzurePlans and resellers. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a customer by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String customerName, String expand) { - return getWithResponseAsync(billingAccountName, customerName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft - * Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a customer by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String customerName) { - final String expand = null; - return getWithResponseAsync(billingAccountName, customerName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft - * Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a customer by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomerInner get(String billingAccountName, String customerName) { - final String expand = null; - return getAsync(billingAccountName, customerName, expand).block(); - } - - /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft - * Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param expand May be used to expand enabledAzurePlans and resellers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a customer by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String customerName, String expand, Context context) { - return getWithResponseAsync(billingAccountName, customerName, expand, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersImpl.java deleted file mode 100644 index 4bdc72997dde..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.CustomersClient; -import com.azure.resourcemanager.billing.fluent.models.CustomerInner; -import com.azure.resourcemanager.billing.models.Customer; -import com.azure.resourcemanager.billing.models.Customers; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class CustomersImpl implements Customers { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomersImpl.class); - - private final CustomersClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public CustomersImpl(CustomersClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new CustomerImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String search, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, search, filter, context); - return Utils.mapPage(inner, inner1 -> new CustomerImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new CustomerImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount( - String billingAccountName, String search, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, search, filter, context); - return Utils.mapPage(inner, inner1 -> new CustomerImpl(inner1, this.manager())); - } - - public Customer get(String billingAccountName, String customerName) { - CustomerInner inner = this.serviceClient().get(billingAccountName, customerName); - if (inner != null) { - return new CustomerImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String billingAccountName, String customerName, String expand, Context context) { - Response inner = - this.serviceClient().getWithResponse(billingAccountName, customerName, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CustomerImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private CustomersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/DownloadUrlImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/DownloadUrlImpl.java deleted file mode 100644 index 8a9e1794905c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/DownloadUrlImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.time.OffsetDateTime; - -public final class DownloadUrlImpl implements DownloadUrl { - private DownloadUrlInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - DownloadUrlImpl(DownloadUrlInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public OffsetDateTime expiryTime() { - return this.innerModel().expiryTime(); - } - - public String url() { - return this.innerModel().url(); - } - - public DownloadUrlInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountSummaryImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountSummaryImpl.java deleted file mode 100644 index d369fe44c1a8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountSummaryImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; -import com.azure.resourcemanager.billing.models.EnrollmentAccountSummary; - -public final class EnrollmentAccountSummaryImpl implements EnrollmentAccountSummary { - private EnrollmentAccountSummaryInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - EnrollmentAccountSummaryImpl( - EnrollmentAccountSummaryInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String principalName() { - return this.innerModel().principalName(); - } - - public EnrollmentAccountSummaryInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsClientImpl.java deleted file mode 100644 index 4239f5be7586..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsClientImpl.java +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.EnrollmentAccountsClient; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; -import com.azure.resourcemanager.billing.models.EnrollmentAccountListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in EnrollmentAccountsClient. */ -public final class EnrollmentAccountsClientImpl implements EnrollmentAccountsClient { - private final ClientLogger logger = new ClientLogger(EnrollmentAccountsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final EnrollmentAccountsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of EnrollmentAccountsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - EnrollmentAccountsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(EnrollmentAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientEnrollmentAccounts to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface EnrollmentAccountsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/enrollmentAccounts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/enrollmentAccounts/{name}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists the enrollment accounts the caller has access to. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), name, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String apiVersion = "2018-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), name, apiVersion, accept, context); - } - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String name) { - return getWithResponseAsync(name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnrollmentAccountSummaryInner get(String name) { - return getAsync(name).block(); - } - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String name, Context context) { - return getWithResponseAsync(name, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsImpl.java deleted file mode 100644 index f30584f5519e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.EnrollmentAccountsClient; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; -import com.azure.resourcemanager.billing.models.EnrollmentAccountSummary; -import com.azure.resourcemanager.billing.models.EnrollmentAccounts; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class EnrollmentAccountsImpl implements EnrollmentAccounts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrollmentAccountsImpl.class); - - private final EnrollmentAccountsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public EnrollmentAccountsImpl( - EnrollmentAccountsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new EnrollmentAccountSummaryImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new EnrollmentAccountSummaryImpl(inner1, this.manager())); - } - - public EnrollmentAccountSummary get(String name) { - EnrollmentAccountSummaryInner inner = this.serviceClient().get(name); - if (inner != null) { - return new EnrollmentAccountSummaryImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String name, Context context) { - Response inner = this.serviceClient().getWithResponse(name, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EnrollmentAccountSummaryImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private EnrollmentAccountsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionImpl.java deleted file mode 100644 index 34c17330dbea..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import com.azure.resourcemanager.billing.models.Instruction; -import java.time.OffsetDateTime; - -public final class InstructionImpl implements Instruction { - private InstructionInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - InstructionImpl(InstructionInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public float amount() { - return this.innerModel().amount(); - } - - public OffsetDateTime startDate() { - return this.innerModel().startDate(); - } - - public OffsetDateTime endDate() { - return this.innerModel().endDate(); - } - - public OffsetDateTime creationDate() { - return this.innerModel().creationDate(); - } - - public InstructionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java deleted file mode 100644 index f80d1a0aac5e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java +++ /dev/null @@ -1,700 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.InstructionsClient; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import com.azure.resourcemanager.billing.models.InstructionListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in InstructionsClient. */ -public final class InstructionsClientImpl implements InstructionsClient { - private final ClientLogger logger = new ClientLogger(InstructionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final InstructionsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of InstructionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - InstructionsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(InstructionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientInstructions to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface InstructionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/instructions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/instructions/{instructionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("instructionName") String instructionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/instructions/{instructionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> put( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("instructionName") String instructionName, - @BodyParam("application/json") InstructionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the instructions by billing profile id. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the instructions by billing profile id. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), billingAccountName, billingProfileName, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the instructions by billing profile id. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the instructions by billing profile id. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the instructions by billing profile id. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); - } - - /** - * Lists the instructions by billing profile id. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); - } - - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instruction by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String billingProfileName, String instructionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (instructionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter instructionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - instructionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instruction by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String billingProfileName, String instructionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (instructionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter instructionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - instructionName, - accept, - context); - } - - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instruction by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String billingAccountName, String billingProfileName, String instructionName) { - return getWithResponseAsync(billingAccountName, billingProfileName, instructionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instruction by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InstructionInner get(String billingAccountName, String billingProfileName, String instructionName) { - return getAsync(billingAccountName, billingProfileName, instructionName).block(); - } - - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instruction by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String billingProfileName, String instructionName, Context context) { - return getWithResponseAsync(billingAccountName, billingProfileName, instructionName, context).block(); - } - - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for certain - * customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instruction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync( - String billingAccountName, String billingProfileName, String instructionName, InstructionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (instructionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter instructionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .put( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - instructionName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for certain - * customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instruction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync( - String billingAccountName, - String billingProfileName, - String instructionName, - InstructionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (instructionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter instructionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .put( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - instructionName, - parameters, - accept, - context); - } - - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for certain - * customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instruction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putAsync( - String billingAccountName, String billingProfileName, String instructionName, InstructionInner parameters) { - return putWithResponseAsync(billingAccountName, billingProfileName, instructionName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for certain - * customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instruction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InstructionInner put( - String billingAccountName, String billingProfileName, String instructionName, InstructionInner parameters) { - return putAsync(billingAccountName, billingProfileName, instructionName, parameters).block(); - } - - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for certain - * customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instruction. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse( - String billingAccountName, - String billingProfileName, - String instructionName, - InstructionInner parameters, - Context context) { - return putWithResponseAsync(billingAccountName, billingProfileName, instructionName, parameters, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsImpl.java deleted file mode 100644 index b41a5b565c99..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.InstructionsClient; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import com.azure.resourcemanager.billing.models.Instruction; -import com.azure.resourcemanager.billing.models.Instructions; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class InstructionsImpl implements Instructions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InstructionsImpl.class); - - private final InstructionsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public InstructionsImpl( - InstructionsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new InstructionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); - return Utils.mapPage(inner, inner1 -> new InstructionImpl(inner1, this.manager())); - } - - public Instruction get(String billingAccountName, String billingProfileName, String instructionName) { - InstructionInner inner = this.serviceClient().get(billingAccountName, billingProfileName, instructionName); - if (inner != null) { - return new InstructionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String billingAccountName, String billingProfileName, String instructionName, Context context) { - Response inner = - this.serviceClient().getWithResponse(billingAccountName, billingProfileName, instructionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new InstructionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Instruction put( - String billingAccountName, String billingProfileName, String instructionName, InstructionInner parameters) { - InstructionInner inner = - this.serviceClient().put(billingAccountName, billingProfileName, instructionName, parameters); - if (inner != null) { - return new InstructionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response putWithResponse( - String billingAccountName, - String billingProfileName, - String instructionName, - InstructionInner parameters, - Context context) { - Response inner = - this - .serviceClient() - .putWithResponse(billingAccountName, billingProfileName, instructionName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new InstructionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private InstructionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceImpl.java deleted file mode 100644 index 0b4a03825207..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.Document; -import com.azure.resourcemanager.billing.models.Invoice; -import com.azure.resourcemanager.billing.models.InvoiceDocumentType; -import com.azure.resourcemanager.billing.models.InvoiceStatus; -import com.azure.resourcemanager.billing.models.InvoiceType; -import com.azure.resourcemanager.billing.models.PaymentProperties; -import com.azure.resourcemanager.billing.models.RebillDetails; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class InvoiceImpl implements Invoice { - private InvoiceInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - InvoiceImpl(InvoiceInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public OffsetDateTime dueDate() { - return this.innerModel().dueDate(); - } - - public OffsetDateTime invoiceDate() { - return this.innerModel().invoiceDate(); - } - - public InvoiceStatus status() { - return this.innerModel().status(); - } - - public Amount amountDue() { - return this.innerModel().amountDue(); - } - - public Amount azurePrepaymentApplied() { - return this.innerModel().azurePrepaymentApplied(); - } - - public Amount billedAmount() { - return this.innerModel().billedAmount(); - } - - public Amount creditAmount() { - return this.innerModel().creditAmount(); - } - - public Amount freeAzureCreditApplied() { - return this.innerModel().freeAzureCreditApplied(); - } - - public Amount subTotal() { - return this.innerModel().subTotal(); - } - - public Amount taxAmount() { - return this.innerModel().taxAmount(); - } - - public Amount totalAmount() { - return this.innerModel().totalAmount(); - } - - public OffsetDateTime invoicePeriodStartDate() { - return this.innerModel().invoicePeriodStartDate(); - } - - public OffsetDateTime invoicePeriodEndDate() { - return this.innerModel().invoicePeriodEndDate(); - } - - public InvoiceType invoiceType() { - return this.innerModel().invoiceType(); - } - - public Boolean isMonthlyInvoice() { - return this.innerModel().isMonthlyInvoice(); - } - - public String billingProfileId() { - return this.innerModel().billingProfileId(); - } - - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); - } - - public String purchaseOrderNumber() { - return this.innerModel().purchaseOrderNumber(); - } - - public List documents() { - List inner = this.innerModel().documents(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List payments() { - List inner = this.innerModel().payments(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Map rebillDetails() { - Map inner = this.innerModel().rebillDetails(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public InvoiceDocumentType documentType() { - return this.innerModel().documentType(); - } - - public String billedDocumentId() { - return this.innerModel().billedDocumentId(); - } - - public String creditForDocumentId() { - return this.innerModel().creditForDocumentId(); - } - - public String subscriptionId() { - return this.innerModel().subscriptionId(); - } - - public InvoiceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionImpl.java deleted file mode 100644 index 3015965629c0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import com.azure.resourcemanager.billing.models.InvoiceSectionState; -import com.azure.resourcemanager.billing.models.TargetCloud; -import java.util.Collections; -import java.util.Map; - -public final class InvoiceSectionImpl implements InvoiceSection { - private InvoiceSectionInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - InvoiceSectionImpl( - InvoiceSectionInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Map labels() { - Map inner = this.innerModel().labels(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public InvoiceSectionState state() { - return this.innerModel().state(); - } - - public String systemId() { - return this.innerModel().systemId(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public TargetCloud targetCloud() { - return this.innerModel().targetCloud(); - } - - public InvoiceSectionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionWithCreateSubPermissionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionWithCreateSubPermissionImpl.java deleted file mode 100644 index 97779e42498e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionWithCreateSubPermissionImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionWithCreateSubPermissionInner; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.BillingProfileStatus; -import com.azure.resourcemanager.billing.models.InvoiceSectionWithCreateSubPermission; -import com.azure.resourcemanager.billing.models.SpendingLimitForBillingProfile; -import com.azure.resourcemanager.billing.models.StatusReasonCodeForBillingProfile; -import java.util.Collections; -import java.util.List; - -public final class InvoiceSectionWithCreateSubPermissionImpl implements InvoiceSectionWithCreateSubPermission { - private InvoiceSectionWithCreateSubPermissionInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - InvoiceSectionWithCreateSubPermissionImpl( - InvoiceSectionWithCreateSubPermissionInner innerObject, - com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String invoiceSectionId() { - return this.innerModel().invoiceSectionId(); - } - - public String invoiceSectionDisplayName() { - return this.innerModel().invoiceSectionDisplayName(); - } - - public String invoiceSectionSystemId() { - return this.innerModel().invoiceSectionSystemId(); - } - - public String billingProfileId() { - return this.innerModel().billingProfileId(); - } - - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); - } - - public BillingProfileStatus billingProfileStatus() { - return this.innerModel().billingProfileStatus(); - } - - public StatusReasonCodeForBillingProfile billingProfileStatusReasonCode() { - return this.innerModel().billingProfileStatusReasonCode(); - } - - public SpendingLimitForBillingProfile billingProfileSpendingLimit() { - return this.innerModel().billingProfileSpendingLimit(); - } - - public String billingProfileSystemId() { - return this.innerModel().billingProfileSystemId(); - } - - public List enabledAzurePlans() { - List inner = this.innerModel().enabledAzurePlans(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public InvoiceSectionWithCreateSubPermissionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java deleted file mode 100644 index ddbcf36b8cab..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java +++ /dev/null @@ -1,856 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.InvoiceSectionsClient; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.azure.resourcemanager.billing.models.InvoiceSectionListResult; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in InvoiceSectionsClient. */ -public final class InvoiceSectionsClientImpl implements InvoiceSectionsClient { - private final ClientLogger logger = new ClientLogger(InvoiceSectionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final InvoiceSectionsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of InvoiceSectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - InvoiceSectionsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(InvoiceSectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientInvoiceSections to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface InvoiceSectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, - @BodyParam("application/json") InvoiceSectionInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), apiVersion, billingAccountName, billingProfileName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName)); - } - - /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, context)); - } - - /** - * Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - accept, - context); - } - - /** - * Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return getWithResponseAsync(billingAccountName, billingProfileName, invoiceSectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InvoiceSectionInner get(String billingAccountName, String billingProfileName, String invoiceSectionName) { - return getAsync(billingAccountName, billingProfileName, invoiceSectionName).block(); - } - - /** - * Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section by its ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return getWithResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, context).block(); - } - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - invoiceSectionName, - parameters, - accept, - context); - } - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, InvoiceSectionInner> beginCreateOrUpdateAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - InvoiceSectionInner.class, - InvoiceSectionInner.class, - Context.NONE); - } - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, InvoiceSectionInner> beginCreateOrUpdateAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), InvoiceSectionInner.class, InvoiceSectionInner.class, context); - } - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, InvoiceSectionInner> beginCreateOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters) { - return beginCreateOrUpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters) - .getSyncPoller(); - } - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, InvoiceSectionInner> beginCreateOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters, - Context context) { - return beginCreateOrUpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, context) - .getSyncPoller(); - } - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters) { - return beginCreateOrUpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters, - Context context) { - return beginCreateOrUpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InvoiceSectionInner createOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters) { - return createOrUpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).block(); - } - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InvoiceSectionInner createOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters, - Context context) { - return createOrUpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsImpl.java deleted file mode 100644 index 1552947cbe8d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.InvoiceSectionsClient; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import com.azure.resourcemanager.billing.models.InvoiceSections; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class InvoiceSectionsImpl implements InvoiceSections { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoiceSectionsImpl.class); - - private final InvoiceSectionsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public InvoiceSectionsImpl( - InvoiceSectionsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new InvoiceSectionImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, context); - return Utils.mapPage(inner, inner1 -> new InvoiceSectionImpl(inner1, this.manager())); - } - - public InvoiceSection get(String billingAccountName, String billingProfileName, String invoiceSectionName) { - InvoiceSectionInner inner = - this.serviceClient().get(billingAccountName, billingProfileName, invoiceSectionName); - if (inner != null) { - return new InvoiceSectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - Response inner = - this.serviceClient().getWithResponse(billingAccountName, billingProfileName, invoiceSectionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new InvoiceSectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public InvoiceSection createOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters) { - InvoiceSectionInner inner = - this.serviceClient().createOrUpdate(billingAccountName, billingProfileName, invoiceSectionName, parameters); - if (inner != null) { - return new InvoiceSectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public InvoiceSection createOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters, - Context context) { - InvoiceSectionInner inner = - this - .serviceClient() - .createOrUpdate(billingAccountName, billingProfileName, invoiceSectionName, parameters, context); - if (inner != null) { - return new InvoiceSectionImpl(inner, this.manager()); - } else { - return null; - } - } - - private InvoiceSectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java deleted file mode 100644 index 3580b77b2e36..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java +++ /dev/null @@ -1,2364 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.billing.fluent.InvoicesClient; -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; -import com.azure.resourcemanager.billing.models.InvoiceListResult; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in InvoicesClient. */ -public final class InvoicesClientImpl implements InvoicesClient { - private final ClientLogger logger = new ClientLogger(InvoicesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final InvoicesService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of InvoicesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - InvoicesClientImpl(BillingManagementClientImpl client) { - this.service = RestProxy.create(InvoicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientInvoices to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface InvoicesService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @QueryParam("periodStartDate") String periodStartDate, - @QueryParam("periodEndDate") String periodEndDate, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @QueryParam("periodStartDate") String periodStartDate, - @QueryParam("periodEndDate") String periodEndDate, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("invoiceName") String invoiceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/default/invoices/{invoiceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getById( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("invoiceName") String invoiceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadInvoice( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("invoiceName") String invoiceName, - @QueryParam("downloadToken") String downloadToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadMultipleBillingProfileInvoices( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @BodyParam("application/json") List downloadUrls, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingSubscription( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("periodStartDate") String periodStartDate, - @QueryParam("periodEndDate") String periodEndDate, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices" - + "/{invoiceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBySubscriptionAndInvoiceId( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("invoiceName") String invoiceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices" - + "/{invoiceName}/download") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadBillingSubscriptionInvoice( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("invoiceName") String invoiceName, - @QueryParam("downloadToken") String downloadToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}" - + "/downloadDocuments") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadMultipleBillingSubscriptionInvoices( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") List downloadUrls, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingSubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String periodStartDate, String periodEndDate) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (periodStartDate == null) { - return Mono - .error(new IllegalArgumentException("Parameter periodStartDate is required and cannot be null.")); - } - if (periodEndDate == null) { - return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - periodStartDate, - periodEndDate, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String periodStartDate, String periodEndDate, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (periodStartDate == null) { - return Mono - .error(new IllegalArgumentException("Parameter periodStartDate is required and cannot be null.")); - } - if (periodEndDate == null) { - return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccount( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - periodStartDate, - periodEndDate, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String periodStartDate, String periodEndDate) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, periodStartDate, periodEndDate), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String periodStartDate, String periodEndDate, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, periodStartDate, periodEndDate, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate)); - } - - /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate, Context context) { - return new PagedIterable<>( - listByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate, context)); - } - - /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (periodStartDate == null) { - return Mono - .error(new IllegalArgumentException("Parameter periodStartDate is required and cannot be null.")); - } - if (periodEndDate == null) { - return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (periodStartDate == null) { - return Mono - .error(new IllegalArgumentException("Parameter periodStartDate is required and cannot be null.")); - } - if (periodEndDate == null) { - return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - periodStartDate, - periodEndDate, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { - return new PagedFlux<>( - () -> - listByBillingProfileSinglePageAsync( - billingAccountName, billingProfileName, periodStartDate, periodEndDate), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context) { - return new PagedFlux<>( - () -> - listByBillingProfileSinglePageAsync( - billingAccountName, billingProfileName, periodStartDate, periodEndDate, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { - return new PagedIterable<>( - listByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate)); - } - - /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context) { - return new PagedIterable<>( - listByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate, context)); - } - - /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by billing account name and ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingAccountName, String invoiceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), apiVersion, billingAccountName, invoiceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by billing account name and ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String invoiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, billingAccountName, invoiceName, accept, context); - } - - /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by billing account name and ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String invoiceName) { - return getWithResponseAsync(billingAccountName, invoiceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by billing account name and ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InvoiceInner get(String billingAccountName, String invoiceName) { - return getAsync(billingAccountName, invoiceName).block(); - } - - /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by billing account name and ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingAccountName, String invoiceName, Context context) { - return getWithResponseAsync(billingAccountName, invoiceName, context).block(); - } - - /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByIdWithResponseAsync(String invoiceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getById(this.client.getEndpoint(), apiVersion, invoiceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByIdWithResponseAsync(String invoiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getById(this.client.getEndpoint(), apiVersion, invoiceName, accept, context); - } - - /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByIdAsync(String invoiceName) { - return getByIdWithResponseAsync(invoiceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InvoiceInner getById(String invoiceName) { - return getByIdAsync(invoiceName).block(); - } - - /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByIdWithResponse(String invoiceName, Context context) { - return getByIdWithResponseAsync(invoiceName, context).block(); - } - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadInvoiceWithResponseAsync( - String billingAccountName, String invoiceName, String downloadToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - if (downloadToken == null) { - return Mono.error(new IllegalArgumentException("Parameter downloadToken is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .downloadInvoice( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - invoiceName, - downloadToken, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadInvoiceWithResponseAsync( - String billingAccountName, String invoiceName, String downloadToken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - if (downloadToken == null) { - return Mono.error(new IllegalArgumentException("Parameter downloadToken is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .downloadInvoice( - this.client.getEndpoint(), apiVersion, billingAccountName, invoiceName, downloadToken, accept, context); - } - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> beginDownloadInvoiceAsync( - String billingAccountName, String invoiceName, String downloadToken) { - Mono>> mono = - downloadInvoiceWithResponseAsync(billingAccountName, invoiceName, downloadToken); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, Context.NONE); - } - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> beginDownloadInvoiceAsync( - String billingAccountName, String invoiceName, String downloadToken, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - downloadInvoiceWithResponseAsync(billingAccountName, invoiceName, downloadToken, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, context); - } - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadInvoice( - String billingAccountName, String invoiceName, String downloadToken) { - return beginDownloadInvoiceAsync(billingAccountName, invoiceName, downloadToken).getSyncPoller(); - } - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadInvoice( - String billingAccountName, String invoiceName, String downloadToken, Context context) { - return beginDownloadInvoiceAsync(billingAccountName, invoiceName, downloadToken, context).getSyncPoller(); - } - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadInvoiceAsync( - String billingAccountName, String invoiceName, String downloadToken) { - return beginDownloadInvoiceAsync(billingAccountName, invoiceName, downloadToken) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadInvoiceAsync( - String billingAccountName, String invoiceName, String downloadToken, Context context) { - return beginDownloadInvoiceAsync(billingAccountName, invoiceName, downloadToken, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadInvoice(String billingAccountName, String invoiceName, String downloadToken) { - return downloadInvoiceAsync(billingAccountName, invoiceName, downloadToken).block(); - } - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadInvoice( - String billingAccountName, String invoiceName, String downloadToken, Context context) { - return downloadInvoiceAsync(billingAccountName, invoiceName, downloadToken, context).block(); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadMultipleBillingProfileInvoicesWithResponseAsync( - String billingAccountName, List downloadUrls) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (downloadUrls == null) { - return Mono.error(new IllegalArgumentException("Parameter downloadUrls is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .downloadMultipleBillingProfileInvoices( - this.client.getEndpoint(), apiVersion, billingAccountName, downloadUrls, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadMultipleBillingProfileInvoicesWithResponseAsync( - String billingAccountName, List downloadUrls, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (downloadUrls == null) { - return Mono.error(new IllegalArgumentException("Parameter downloadUrls is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .downloadMultipleBillingProfileInvoices( - this.client.getEndpoint(), apiVersion, billingAccountName, downloadUrls, accept, context); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoicesAsync( - String billingAccountName, List downloadUrls) { - Mono>> mono = - downloadMultipleBillingProfileInvoicesWithResponseAsync(billingAccountName, downloadUrls); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, Context.NONE); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoicesAsync( - String billingAccountName, List downloadUrls, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - downloadMultipleBillingProfileInvoicesWithResponseAsync(billingAccountName, downloadUrls, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, context); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls) { - return beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls).getSyncPoller(); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context) { - return beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls, context) - .getSyncPoller(); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadMultipleBillingProfileInvoicesAsync( - String billingAccountName, List downloadUrls) { - return beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadMultipleBillingProfileInvoicesAsync( - String billingAccountName, List downloadUrls, Context context) { - return beginDownloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls) { - return downloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls).block(); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context) { - return downloadMultipleBillingProfileInvoicesAsync(billingAccountName, downloadUrls, context).block(); - } - - /** - * Lists the invoices for a subscription. - * - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingSubscriptionSinglePageAsync( - String periodStartDate, String periodEndDate) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (periodStartDate == null) { - return Mono - .error(new IllegalArgumentException("Parameter periodStartDate is required and cannot be null.")); - } - if (periodEndDate == null) { - return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingSubscription( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - periodStartDate, - periodEndDate, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the invoices for a subscription. - * - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingSubscriptionSinglePageAsync( - String periodStartDate, String periodEndDate, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (periodStartDate == null) { - return Mono - .error(new IllegalArgumentException("Parameter periodStartDate is required and cannot be null.")); - } - if (periodEndDate == null) { - return Mono.error(new IllegalArgumentException("Parameter periodEndDate is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingSubscription( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - periodStartDate, - periodEndDate, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the invoices for a subscription. - * - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingSubscriptionAsync(String periodStartDate, String periodEndDate) { - return new PagedFlux<>( - () -> listByBillingSubscriptionSinglePageAsync(periodStartDate, periodEndDate), - nextLink -> listByBillingSubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists the invoices for a subscription. - * - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingSubscriptionAsync( - String periodStartDate, String periodEndDate, Context context) { - return new PagedFlux<>( - () -> listByBillingSubscriptionSinglePageAsync(periodStartDate, periodEndDate, context), - nextLink -> listByBillingSubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the invoices for a subscription. - * - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingSubscription(String periodStartDate, String periodEndDate) { - return new PagedIterable<>(listByBillingSubscriptionAsync(periodStartDate, periodEndDate)); - } - - /** - * Lists the invoices for a subscription. - * - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingSubscription( - String periodStartDate, String periodEndDate, Context context) { - return new PagedIterable<>(listByBillingSubscriptionAsync(periodStartDate, periodEndDate, context)); - } - - /** - * Gets an invoice by subscription ID and invoice ID. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by subscription ID and invoice ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBySubscriptionAndInvoiceIdWithResponseAsync(String invoiceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getBySubscriptionAndInvoiceId( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - invoiceName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an invoice by subscription ID and invoice ID. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by subscription ID and invoice ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBySubscriptionAndInvoiceIdWithResponseAsync( - String invoiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getBySubscriptionAndInvoiceId( - this.client.getEndpoint(), this.client.getSubscriptionId(), invoiceName, apiVersion, accept, context); - } - - /** - * Gets an invoice by subscription ID and invoice ID. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by subscription ID and invoice ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getBySubscriptionAndInvoiceIdAsync(String invoiceName) { - return getBySubscriptionAndInvoiceIdWithResponseAsync(invoiceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an invoice by subscription ID and invoice ID. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by subscription ID and invoice ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InvoiceInner getBySubscriptionAndInvoiceId(String invoiceName) { - return getBySubscriptionAndInvoiceIdAsync(invoiceName).block(); - } - - /** - * Gets an invoice by subscription ID and invoice ID. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by subscription ID and invoice ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, Context context) { - return getBySubscriptionAndInvoiceIdWithResponseAsync(invoiceName, context).block(); - } - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadBillingSubscriptionInvoiceWithResponseAsync( - String invoiceName, String downloadToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - if (downloadToken == null) { - return Mono.error(new IllegalArgumentException("Parameter downloadToken is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .downloadBillingSubscriptionInvoice( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - invoiceName, - downloadToken, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadBillingSubscriptionInvoiceWithResponseAsync( - String invoiceName, String downloadToken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - if (downloadToken == null) { - return Mono.error(new IllegalArgumentException("Parameter downloadToken is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .downloadBillingSubscriptionInvoice( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - invoiceName, - downloadToken, - accept, - context); - } - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> beginDownloadBillingSubscriptionInvoiceAsync( - String invoiceName, String downloadToken) { - Mono>> mono = - downloadBillingSubscriptionInvoiceWithResponseAsync(invoiceName, downloadToken); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, Context.NONE); - } - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> beginDownloadBillingSubscriptionInvoiceAsync( - String invoiceName, String downloadToken, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - downloadBillingSubscriptionInvoiceWithResponseAsync(invoiceName, downloadToken, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, context); - } - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken) { - return beginDownloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken).getSyncPoller(); - } - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken, Context context) { - return beginDownloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken, context).getSyncPoller(); - } - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadBillingSubscriptionInvoiceAsync(String invoiceName, String downloadToken) { - return beginDownloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadBillingSubscriptionInvoiceAsync( - String invoiceName, String downloadToken, Context context) { - return beginDownloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken) { - return downloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken).block(); - } - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken, Context context) { - return downloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken, context).block(); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadMultipleBillingSubscriptionInvoicesWithResponseAsync( - List downloadUrls) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (downloadUrls == null) { - return Mono.error(new IllegalArgumentException("Parameter downloadUrls is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .downloadMultipleBillingSubscriptionInvoices( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - downloadUrls, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadMultipleBillingSubscriptionInvoicesWithResponseAsync( - List downloadUrls, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (downloadUrls == null) { - return Mono.error(new IllegalArgumentException("Parameter downloadUrls is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .downloadMultipleBillingSubscriptionInvoices( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), downloadUrls, accept, context); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> - beginDownloadMultipleBillingSubscriptionInvoicesAsync(List downloadUrls) { - Mono>> mono = - downloadMultipleBillingSubscriptionInvoicesWithResponseAsync(downloadUrls); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, Context.NONE); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DownloadUrlInner> - beginDownloadMultipleBillingSubscriptionInvoicesAsync(List downloadUrls, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - downloadMultipleBillingSubscriptionInvoicesWithResponseAsync(downloadUrls, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DownloadUrlInner.class, DownloadUrlInner.class, context); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( - List downloadUrls) { - return beginDownloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls).getSyncPoller(); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadMultipleBillingSubscriptionInvoices( - List downloadUrls, Context context) { - return beginDownloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls, context).getSyncPoller(); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadMultipleBillingSubscriptionInvoicesAsync(List downloadUrls) { - return beginDownloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadMultipleBillingSubscriptionInvoicesAsync( - List downloadUrls, Context context) { - return beginDownloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadMultipleBillingSubscriptionInvoices(List downloadUrls) { - return downloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls).block(); - } - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DownloadUrlInner downloadMultipleBillingSubscriptionInvoices(List downloadUrls, Context context) { - return downloadMultipleBillingSubscriptionInvoicesAsync(downloadUrls, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingSubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingSubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingSubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingSubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesImpl.java deleted file mode 100644 index 76d0d8511598..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.InvoicesClient; -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; -import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import com.azure.resourcemanager.billing.models.Invoice; -import com.azure.resourcemanager.billing.models.Invoices; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.List; - -public final class InvoicesImpl implements Invoices { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoicesImpl.class); - - private final InvoicesClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public InvoicesImpl(InvoicesClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, periodStartDate, periodEndDate); - return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, periodStartDate, periodEndDate, context); - return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate) { - PagedIterable inner = - this - .serviceClient() - .listByBillingProfile(billingAccountName, billingProfileName, periodStartDate, periodEndDate); - return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByBillingProfile(billingAccountName, billingProfileName, periodStartDate, periodEndDate, context); - return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); - } - - public Invoice get(String billingAccountName, String invoiceName) { - InvoiceInner inner = this.serviceClient().get(billingAccountName, invoiceName); - if (inner != null) { - return new InvoiceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String billingAccountName, String invoiceName, Context context) { - Response inner = this.serviceClient().getWithResponse(billingAccountName, invoiceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new InvoiceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Invoice getById(String invoiceName) { - InvoiceInner inner = this.serviceClient().getById(invoiceName); - if (inner != null) { - return new InvoiceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByIdWithResponse(String invoiceName, Context context) { - Response inner = this.serviceClient().getByIdWithResponse(invoiceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new InvoiceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DownloadUrl downloadInvoice(String billingAccountName, String invoiceName, String downloadToken) { - DownloadUrlInner inner = this.serviceClient().downloadInvoice(billingAccountName, invoiceName, downloadToken); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public DownloadUrl downloadInvoice( - String billingAccountName, String invoiceName, String downloadToken, Context context) { - DownloadUrlInner inner = - this.serviceClient().downloadInvoice(billingAccountName, invoiceName, downloadToken, context); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public DownloadUrl downloadMultipleBillingProfileInvoices(String billingAccountName, List downloadUrls) { - DownloadUrlInner inner = - this.serviceClient().downloadMultipleBillingProfileInvoices(billingAccountName, downloadUrls); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public DownloadUrl downloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context) { - DownloadUrlInner inner = - this.serviceClient().downloadMultipleBillingProfileInvoices(billingAccountName, downloadUrls, context); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByBillingSubscription(String periodStartDate, String periodEndDate) { - PagedIterable inner = - this.serviceClient().listByBillingSubscription(periodStartDate, periodEndDate); - return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingSubscription( - String periodStartDate, String periodEndDate, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingSubscription(periodStartDate, periodEndDate, context); - return Utils.mapPage(inner, inner1 -> new InvoiceImpl(inner1, this.manager())); - } - - public Invoice getBySubscriptionAndInvoiceId(String invoiceName) { - InvoiceInner inner = this.serviceClient().getBySubscriptionAndInvoiceId(invoiceName); - if (inner != null) { - return new InvoiceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, Context context) { - Response inner = - this.serviceClient().getBySubscriptionAndInvoiceIdWithResponse(invoiceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new InvoiceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DownloadUrl downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken) { - DownloadUrlInner inner = this.serviceClient().downloadBillingSubscriptionInvoice(invoiceName, downloadToken); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public DownloadUrl downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken, Context context) { - DownloadUrlInner inner = - this.serviceClient().downloadBillingSubscriptionInvoice(invoiceName, downloadToken, context); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public DownloadUrl downloadMultipleBillingSubscriptionInvoices(List downloadUrls) { - DownloadUrlInner inner = this.serviceClient().downloadMultipleBillingSubscriptionInvoices(downloadUrls); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - public DownloadUrl downloadMultipleBillingSubscriptionInvoices(List downloadUrls, Context context) { - DownloadUrlInner inner = - this.serviceClient().downloadMultipleBillingSubscriptionInvoices(downloadUrls, context); - if (inner != null) { - return new DownloadUrlImpl(inner, this.manager()); - } else { - return null; - } - } - - private InvoicesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationImpl.java deleted file mode 100644 index 3c68be9db33e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.OperationInner; -import com.azure.resourcemanager.billing.models.Operation; -import com.azure.resourcemanager.billing.models.OperationDisplay; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - OperationImpl(OperationInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsClientImpl.java deleted file mode 100644 index 2c8dd394d526..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.OperationsClient; -import com.azure.resourcemanager.billing.fluent.models.OperationInner; -import com.azure.resourcemanager.billing.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the available billing REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the available billing REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the available billing REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the available billing REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the available billing REST API operations. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists the available billing REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsImpl.java deleted file mode 100644 index 03e76f1aa099..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.OperationsClient; -import com.azure.resourcemanager.billing.fluent.models.OperationInner; -import com.azure.resourcemanager.billing.models.Operation; -import com.azure.resourcemanager.billing.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java deleted file mode 100644 index d96b4f5761a0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java +++ /dev/null @@ -1,704 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.PoliciesClient; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PoliciesClient. */ -public final class PoliciesClientImpl implements PoliciesClient { - private final ClientLogger logger = new ClientLogger(PoliciesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PoliciesService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of PoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PoliciesClientImpl(BillingManagementClientImpl client) { - this.service = RestProxy.create(PoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientPolicies to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface PoliciesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/policies/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingProfile( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/policies/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @BodyParam("application/json") PolicyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies" - + "/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByCustomer( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("customerName") String customerName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies" - + "/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateCustomer( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("customerName") String customerName, - @BodyParam("application/json") CustomerPolicyInner parameters, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByBillingProfile( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingProfileWithResponseAsync( - String billingAccountName, String billingProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByBillingProfile( - this.client.getEndpoint(), billingAccountName, billingProfileName, apiVersion, accept, context); - } - - /** - * Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingProfileAsync(String billingAccountName, String billingProfileName) { - return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyInner getByBillingProfile(String billingAccountName, String billingProfileName) { - return getByBillingProfileAsync(billingAccountName, billingProfileName).block(); - } - - /** - * Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, Context context) { - return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, context).block(); - } - - /** - * Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String billingAccountName, String billingProfileName, PolicyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String billingAccountName, String billingProfileName, PolicyInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - parameters, - accept, - context); - } - - /** - * Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String billingAccountName, String billingProfileName, PolicyInner parameters) { - return updateWithResponseAsync(billingAccountName, billingProfileName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyInner update(String billingAccountName, String billingProfileName, PolicyInner parameters) { - return updateAsync(billingAccountName, billingProfileName, parameters).block(); - } - - /** - * Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String billingAccountName, String billingProfileName, PolicyInner parameters, Context context) { - return updateWithResponseAsync(billingAccountName, billingProfileName, parameters, context).block(); - } - - /** - * Lists the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByCustomerWithResponseAsync( - String billingAccountName, String customerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByCustomer( - this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByCustomerWithResponseAsync( - String billingAccountName, String customerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByCustomer(this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context); - } - - /** - * Lists the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByCustomerAsync(String billingAccountName, String customerName) { - return getByCustomerWithResponseAsync(billingAccountName, customerName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Lists the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomerPolicyInner getByCustomer(String billingAccountName, String customerName) { - return getByCustomerAsync(billingAccountName, customerName).block(); - } - - /** - * Lists the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByCustomerWithResponse( - String billingAccountName, String customerName, Context context) { - return getByCustomerWithResponseAsync(billingAccountName, customerName, context).block(); - } - - /** - * Updates the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateCustomerWithResponseAsync( - String billingAccountName, String customerName, CustomerPolicyInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateCustomer( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - customerName, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateCustomerWithResponseAsync( - String billingAccountName, String customerName, CustomerPolicyInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateCustomer( - this.client.getEndpoint(), apiVersion, billingAccountName, customerName, parameters, accept, context); - } - - /** - * Updates the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateCustomerAsync( - String billingAccountName, String customerName, CustomerPolicyInner parameters) { - return updateCustomerWithResponseAsync(billingAccountName, customerName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomerPolicyInner updateCustomer( - String billingAccountName, String customerName, CustomerPolicyInner parameters) { - return updateCustomerAsync(billingAccountName, customerName, parameters).block(); - } - - /** - * Updates the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateCustomerWithResponse( - String billingAccountName, String customerName, CustomerPolicyInner parameters, Context context) { - return updateCustomerWithResponseAsync(billingAccountName, customerName, parameters, context).block(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesImpl.java deleted file mode 100644 index 5ff31524a507..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.PoliciesClient; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; -import com.azure.resourcemanager.billing.models.CustomerPolicy; -import com.azure.resourcemanager.billing.models.Policies; -import com.azure.resourcemanager.billing.models.Policy; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class PoliciesImpl implements Policies { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PoliciesImpl.class); - - private final PoliciesClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public PoliciesImpl(PoliciesClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Policy getByBillingProfile(String billingAccountName, String billingProfileName) { - PolicyInner inner = this.serviceClient().getByBillingProfile(billingAccountName, billingProfileName); - if (inner != null) { - return new PolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, Context context) { - Response inner = - this.serviceClient().getByBillingProfileWithResponse(billingAccountName, billingProfileName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Policy update(String billingAccountName, String billingProfileName, PolicyInner parameters) { - PolicyInner inner = this.serviceClient().update(billingAccountName, billingProfileName, parameters); - if (inner != null) { - return new PolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse( - String billingAccountName, String billingProfileName, PolicyInner parameters, Context context) { - Response inner = - this.serviceClient().updateWithResponse(billingAccountName, billingProfileName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CustomerPolicy getByCustomer(String billingAccountName, String customerName) { - CustomerPolicyInner inner = this.serviceClient().getByCustomer(billingAccountName, customerName); - if (inner != null) { - return new CustomerPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByCustomerWithResponse( - String billingAccountName, String customerName, Context context) { - Response inner = - this.serviceClient().getByCustomerWithResponse(billingAccountName, customerName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CustomerPolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CustomerPolicy updateCustomer( - String billingAccountName, String customerName, CustomerPolicyInner parameters) { - CustomerPolicyInner inner = this.serviceClient().updateCustomer(billingAccountName, customerName, parameters); - if (inner != null) { - return new CustomerPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateCustomerWithResponse( - String billingAccountName, String customerName, CustomerPolicyInner parameters, Context context) { - Response inner = - this.serviceClient().updateCustomerWithResponse(billingAccountName, customerName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CustomerPolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private PoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PolicyImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PolicyImpl.java deleted file mode 100644 index 082c8eb53101..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PolicyImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.Policy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; - -public final class PolicyImpl implements Policy { - private PolicyInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - PolicyImpl(PolicyInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public MarketplacePurchasesPolicy marketplacePurchases() { - return this.innerModel().marketplacePurchases(); - } - - public ReservationPurchasesPolicy reservationPurchases() { - return this.innerModel().reservationPurchases(); - } - - public ViewChargesPolicy viewCharges() { - return this.innerModel().viewCharges(); - } - - public PolicyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductImpl.java deleted file mode 100644 index fc58f601ea94..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import com.azure.resourcemanager.billing.models.Reseller; -import java.time.OffsetDateTime; - -public final class ProductImpl implements Product { - private ProductInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - ProductImpl(ProductInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public AutoRenew autoRenew() { - return this.innerModel().autoRenew(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public OffsetDateTime purchaseDate() { - return this.innerModel().purchaseDate(); - } - - public String productTypeId() { - return this.innerModel().productTypeId(); - } - - public String productType() { - return this.innerModel().productType(); - } - - public ProductStatusType status() { - return this.innerModel().status(); - } - - public OffsetDateTime endDate() { - return this.innerModel().endDate(); - } - - public BillingFrequency billingFrequency() { - return this.innerModel().billingFrequency(); - } - - public Amount lastCharge() { - return this.innerModel().lastCharge(); - } - - public OffsetDateTime lastChargeDate() { - return this.innerModel().lastChargeDate(); - } - - public Float quantity() { - return this.innerModel().quantity(); - } - - public String skuId() { - return this.innerModel().skuId(); - } - - public String skuDescription() { - return this.innerModel().skuDescription(); - } - - public String tenantId() { - return this.innerModel().tenantId(); - } - - public String availabilityId() { - return this.innerModel().availabilityId(); - } - - public String invoiceSectionId() { - return this.innerModel().invoiceSectionId(); - } - - public String invoiceSectionDisplayName() { - return this.innerModel().invoiceSectionDisplayName(); - } - - public String billingProfileId() { - return this.innerModel().billingProfileId(); - } - - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); - } - - public String customerId() { - return this.innerModel().customerId(); - } - - public String customerDisplayName() { - return this.innerModel().customerDisplayName(); - } - - public Reseller reseller() { - return this.innerModel().reseller(); - } - - public ProductInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java deleted file mode 100644 index 0b77f71f1b35..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java +++ /dev/null @@ -1,1909 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.ProductsClient; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.azure.resourcemanager.billing.fluent.models.ValidateProductTransferEligibilityResultInner; -import com.azure.resourcemanager.billing.models.ProductsListResult; -import com.azure.resourcemanager.billing.models.ProductsMoveResponse; -import com.azure.resourcemanager.billing.models.TransferProductRequestProperties; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ProductsClient. */ -public final class ProductsClientImpl implements ProductsClient { - private final ClientLogger logger = new ClientLogger(ProductsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ProductsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of ProductsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProductsClientImpl(BillingManagementClientImpl client) { - this.service = RestProxy.create(ProductsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientProducts to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface ProductsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomer( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("customerName") String customerName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/products") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/products") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSection( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @PathParam("invoiceSectionName") String invoiceSectionName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("productName") String productName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("productName") String productName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ProductInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/move") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono move( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("productName") String productName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TransferProductRequestProperties parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}" - + "/validateMoveEligibility") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validateMove( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("productName") String productName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TransferProductRequestProperties parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCustomerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceSectionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the products for a customer. These don't include products billed based on usage.The operation is supported - * only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByCustomer( - this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the products for a customer. These don't include products billed based on usage.The operation is supported - * only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerSinglePageAsync( - String billingAccountName, String customerName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (customerName == null) { - return Mono.error(new IllegalArgumentException("Parameter customerName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCustomer(this.client.getEndpoint(), billingAccountName, customerName, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the products for a customer. These don't include products billed based on usage.The operation is supported - * only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync(String billingAccountName, String customerName) { - return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName), - nextLink -> listByCustomerNextSinglePageAsync(nextLink)); - } - - /** - * Lists the products for a customer. These don't include products billed based on usage.The operation is supported - * only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCustomerAsync( - String billingAccountName, String customerName, Context context) { - return new PagedFlux<>( - () -> listByCustomerSinglePageAsync(billingAccountName, customerName, context), - nextLink -> listByCustomerNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the products for a customer. These don't include products billed based on usage.The operation is supported - * only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer(String billingAccountName, String customerName) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName)); - } - - /** - * Lists the products for a customer. These don't include products billed based on usage.The operation is supported - * only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCustomer(String billingAccountName, String customerName, Context context) { - return new PagedIterable<>(listByCustomerAsync(billingAccountName, customerName, context)); - } - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), billingAccountName, apiVersion, filter, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccount(this.client.getEndpoint(), billingAccountName, apiVersion, filter, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName, String filter) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, filter), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { - final String filter = null; - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, filter), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String filter, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountName, filter, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - final String filter = null; - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, filter)); - } - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context) { - return new PagedIterable<>(listByBillingAccountAsync(billingAccountName, filter, context)); - } - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - apiVersion, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, String billingProfileName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), billingAccountName, billingProfileName, apiVersion, filter, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, String filter) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync(String billingAccountName, String billingProfileName) { - final String filter = null; - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName, String filter, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountName, billingProfileName, filter, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - final String filter = null; - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, filter)); - } - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String filter, Context context) { - return new PagedIterable<>(listByBillingProfileAsync(billingAccountName, billingProfileName, filter, context)); - } - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByInvoiceSection( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - invoiceSectionName, - apiVersion, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionSinglePageAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - if (invoiceSectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter invoiceSectionName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceSection( - this.client.getEndpoint(), - billingAccountName, - billingProfileName, - invoiceSectionName, - apiVersion, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName, String filter) { - return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName, filter), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); - } - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - final String filter = null; - return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync(billingAccountName, billingProfileName, invoiceSectionName, filter), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink)); - } - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context) { - return new PagedFlux<>( - () -> - listByInvoiceSectionSinglePageAsync( - billingAccountName, billingProfileName, invoiceSectionName, filter, context), - nextLink -> listByInvoiceSectionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - final String filter = null; - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, filter)); - } - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context) { - return new PagedIterable<>( - listByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, filter, context)); - } - - /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String billingAccountName, String productName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), billingAccountName, productName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountName, String productName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), billingAccountName, productName, apiVersion, accept, context); - } - - /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String productName) { - return getWithResponseAsync(billingAccountName, productName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProductInner get(String billingAccountName, String productName) { - return getAsync(billingAccountName, productName).block(); - } - - /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product by ID. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingAccountName, String productName, Context context) { - return getWithResponseAsync(billingAccountName, productName, context).block(); - } - - /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String billingAccountName, String productName, ProductInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - billingAccountName, - productName, - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String billingAccountName, String productName, ProductInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), billingAccountName, productName, apiVersion, parameters, accept, context); - } - - /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String billingAccountName, String productName, ProductInner parameters) { - return updateWithResponseAsync(billingAccountName, productName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProductInner update(String billingAccountName, String productName, ProductInner parameters) { - return updateAsync(billingAccountName, productName, parameters).block(); - } - - /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String billingAccountName, String productName, ProductInner parameters, Context context) { - return updateWithResponseAsync(billingAccountName, productName, parameters, context).block(); - } - - /** - * Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported only for products that are purchased with a - * recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono moveWithResponseAsync( - String billingAccountName, String productName, TransferProductRequestProperties parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .move( - this.client.getEndpoint(), - billingAccountName, - productName, - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported only for products that are purchased with a - * recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono moveWithResponseAsync( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .move(this.client.getEndpoint(), billingAccountName, productName, apiVersion, parameters, accept, context); - } - - /** - * Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported only for products that are purchased with a - * recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono moveAsync( - String billingAccountName, String productName, TransferProductRequestProperties parameters) { - return moveWithResponseAsync(billingAccountName, productName, parameters) - .flatMap( - (ProductsMoveResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported only for products that are purchased with a - * recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProductInner move( - String billingAccountName, String productName, TransferProductRequestProperties parameters) { - return moveAsync(billingAccountName, productName, parameters).block(); - } - - /** - * Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported only for products that are purchased with a - * recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProductsMoveResponse moveWithResponse( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context) { - return moveWithResponseAsync(billingAccountName, productName, parameters, context).block(); - } - - /** - * Validates if a product's charges can be moved to a new invoice section. This operation is supported only for - * products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the product transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateMoveWithResponseAsync( - String billingAccountName, String productName, TransferProductRequestProperties parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validateMove( - this.client.getEndpoint(), - billingAccountName, - productName, - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates if a product's charges can be moved to a new invoice section. This operation is supported only for - * products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the product transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateMoveWithResponseAsync( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (productName == null) { - return Mono.error(new IllegalArgumentException("Parameter productName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validateMove( - this.client.getEndpoint(), billingAccountName, productName, apiVersion, parameters, accept, context); - } - - /** - * Validates if a product's charges can be moved to a new invoice section. This operation is supported only for - * products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the product transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateMoveAsync( - String billingAccountName, String productName, TransferProductRequestProperties parameters) { - return validateMoveWithResponseAsync(billingAccountName, productName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Validates if a product's charges can be moved to a new invoice section. This operation is supported only for - * products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the product transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateProductTransferEligibilityResultInner validateMove( - String billingAccountName, String productName, TransferProductRequestProperties parameters) { - return validateMoveAsync(billingAccountName, productName, parameters).block(); - } - - /** - * Validates if a product's charges can be moved to a new invoice section. This operation is supported only for - * products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the product transfer eligibility validation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateMoveWithResponse( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context) { - return validateMoveWithResponseAsync(billingAccountName, productName, parameters, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCustomerNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSectionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceSectionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsImpl.java deleted file mode 100644 index 690758ee4553..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsImpl.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.ProductsClient; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.azure.resourcemanager.billing.fluent.models.ValidateProductTransferEligibilityResultInner; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.Products; -import com.azure.resourcemanager.billing.models.ProductsMoveResponse; -import com.azure.resourcemanager.billing.models.TransferProductRequestProperties; -import com.azure.resourcemanager.billing.models.ValidateProductTransferEligibilityResult; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ProductsImpl implements Products { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductsImpl.class); - - private final ProductsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public ProductsImpl(ProductsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByCustomer(String billingAccountName, String customerName) { - PagedIterable inner = this.serviceClient().listByCustomer(billingAccountName, customerName); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public PagedIterable listByCustomer(String billingAccountName, String customerName, Context context) { - PagedIterable inner = - this.serviceClient().listByCustomer(billingAccountName, customerName, context); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountName, filter, context); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName, filter, context); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - PagedIterable inner = - this.serviceClient().listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByInvoiceSection(billingAccountName, billingProfileName, invoiceSectionName, filter, context); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); - } - - public Product get(String billingAccountName, String productName) { - ProductInner inner = this.serviceClient().get(billingAccountName, productName); - if (inner != null) { - return new ProductImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String billingAccountName, String productName, Context context) { - Response inner = this.serviceClient().getWithResponse(billingAccountName, productName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ProductImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Product update(String billingAccountName, String productName, ProductInner parameters) { - ProductInner inner = this.serviceClient().update(billingAccountName, productName, parameters); - if (inner != null) { - return new ProductImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse( - String billingAccountName, String productName, ProductInner parameters, Context context) { - Response inner = - this.serviceClient().updateWithResponse(billingAccountName, productName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ProductImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Product move(String billingAccountName, String productName, TransferProductRequestProperties parameters) { - ProductInner inner = this.serviceClient().move(billingAccountName, productName, parameters); - if (inner != null) { - return new ProductImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response moveWithResponse( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context) { - ProductsMoveResponse inner = - this.serviceClient().moveWithResponse(billingAccountName, productName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ProductImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ValidateProductTransferEligibilityResult validateMove( - String billingAccountName, String productName, TransferProductRequestProperties parameters) { - ValidateProductTransferEligibilityResultInner inner = - this.serviceClient().validateMove(billingAccountName, productName, parameters); - if (inner != null) { - return new ValidateProductTransferEligibilityResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response validateMoveWithResponse( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context) { - Response inner = - this.serviceClient().validateMoveWithResponse(billingAccountName, productName, parameters, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ValidateProductTransferEligibilityResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - private ProductsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationImpl.java deleted file mode 100644 index 69d393921882..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.ReservationInner; -import com.azure.resourcemanager.billing.models.Reservation; -import com.azure.resourcemanager.billing.models.ReservationPropertyUtilization; -import com.azure.resourcemanager.billing.models.ReservationSkuProperty; -import java.util.Collections; -import java.util.List; - -public final class ReservationImpl implements Reservation { - private ReservationInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - ReservationImpl(ReservationInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public ReservationSkuProperty sku() { - return this.innerModel().sku(); - } - - public List appliedScopes() { - List inner = this.innerModel().appliedScopes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String appliedScopeType() { - return this.innerModel().appliedScopeType(); - } - - public String reservedResourceType() { - return this.innerModel().reservedResourceType(); - } - - public Float quantity() { - return this.innerModel().quantity(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public String expiryDate() { - return this.innerModel().expiryDate(); - } - - public String provisioningSubState() { - return this.innerModel().provisioningSubState(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String displayProvisioningState() { - return this.innerModel().displayProvisioningState(); - } - - public String userFriendlyRenewState() { - return this.innerModel().userFriendlyRenewState(); - } - - public String userFriendlyAppliedScopeType() { - return this.innerModel().userFriendlyAppliedScopeType(); - } - - public String effectiveDateTime() { - return this.innerModel().effectiveDateTime(); - } - - public String skuDescription() { - return this.innerModel().skuDescription(); - } - - public String term() { - return this.innerModel().term(); - } - - public Boolean renew() { - return this.innerModel().renew(); - } - - public String renewSource() { - return this.innerModel().renewSource(); - } - - public ReservationPropertyUtilization utilization() { - return this.innerModel().utilization(); - } - - public ReservationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java deleted file mode 100644 index b3727f3364e3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java +++ /dev/null @@ -1,772 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.ReservationsClient; -import com.azure.resourcemanager.billing.fluent.models.ReservationInner; -import com.azure.resourcemanager.billing.models.ReservationsListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ReservationsClient. */ -public final class ReservationsClientImpl implements ReservationsClient { - private final ClientLogger logger = new ClientLogger(ReservationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ReservationsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of ReservationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ReservationsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(ReservationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientReservations to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface ReservationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/reservations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @QueryParam("$filter") String filter, - @QueryParam("$orderby") String orderby, - @QueryParam("refreshSummary") String refreshSummary, - @QueryParam("selectedState") String selectedState, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/reservations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("billingProfileName") String billingProfileName, - @QueryParam("$filter") String filter, - @QueryParam("$orderby") String orderby, - @QueryParam("refreshSummary") String refreshSummary, - @QueryParam("selectedState") String selectedState, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. - * @param selectedState The selected provisioning state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, String filter, String orderby, String refreshSummary, String selectedState) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - filter, - orderby, - refreshSummary, - selectedState, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. - * @param selectedState The selected provisioning state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccount( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - filter, - orderby, - refreshSummary, - selectedState, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. - * @param selectedState The selected provisioning state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, String filter, String orderby, String refreshSummary, String selectedState) { - return new PagedFlux<>( - () -> - listByBillingAccountSinglePageAsync(billingAccountName, filter, orderby, refreshSummary, selectedState), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync(String billingAccountName) { - final String filter = null; - final String orderby = null; - final String refreshSummary = null; - final String selectedState = null; - return new PagedFlux<>( - () -> - listByBillingAccountSinglePageAsync(billingAccountName, filter, orderby, refreshSummary, selectedState), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. - * @param selectedState The selected provisioning state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context) { - return new PagedFlux<>( - () -> - listByBillingAccountSinglePageAsync( - billingAccountName, filter, orderby, refreshSummary, selectedState, context), - nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount(String billingAccountName) { - final String filter = null; - final String orderby = null; - final String refreshSummary = null; - final String selectedState = null; - return new PagedIterable<>( - listByBillingAccountAsync(billingAccountName, filter, orderby, refreshSummary, selectedState)); - } - - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. - * @param selectedState The selected provisioning state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context) { - return new PagedIterable<>( - listByBillingAccountAsync(billingAccountName, filter, orderby, refreshSummary, selectedState, context)); - } - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. - * @param selectedState The selected provisioning state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, - String billingProfileName, - String filter, - String orderby, - String refreshSummary, - String selectedState) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - filter, - orderby, - refreshSummary, - selectedState, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. - * @param selectedState The selected provisioning state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileSinglePageAsync( - String billingAccountName, - String billingProfileName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (billingProfileName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingProfileName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfile( - this.client.getEndpoint(), - apiVersion, - billingAccountName, - billingProfileName, - filter, - orderby, - refreshSummary, - selectedState, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. - * @param selectedState The selected provisioning state. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, - String billingProfileName, - String filter, - String orderby, - String refreshSummary, - String selectedState) { - return new PagedFlux<>( - () -> - listByBillingProfileSinglePageAsync( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, String billingProfileName) { - final String filter = null; - final String orderby = null; - final String refreshSummary = null; - final String selectedState = null; - return new PagedFlux<>( - () -> - listByBillingProfileSinglePageAsync( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); - } - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. - * @param selectedState The selected provisioning state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountName, - String billingProfileName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context) { - return new PagedFlux<>( - () -> - listByBillingProfileSinglePageAsync( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState, context), - nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - final String filter = null; - final String orderby = null; - final String refreshSummary = null; - final String selectedState = null; - return new PagedIterable<>( - listByBillingProfileAsync( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState)); - } - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. - * @param selectedState The selected provisioning state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context) { - return new PagedIterable<>( - listByBillingProfileAsync( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingProfileNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsImpl.java deleted file mode 100644 index f0e4a5bde6c1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.ReservationsClient; -import com.azure.resourcemanager.billing.fluent.models.ReservationInner; -import com.azure.resourcemanager.billing.models.Reservation; -import com.azure.resourcemanager.billing.models.Reservations; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ReservationsImpl implements Reservations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationsImpl.class); - - private final ReservationsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public ReservationsImpl( - ReservationsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByBillingAccount(String billingAccountName) { - PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName); - return Utils.mapPage(inner, inner1 -> new ReservationImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingAccount( - String billingAccountName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByBillingAccount(billingAccountName, filter, orderby, refreshSummary, selectedState, context); - return Utils.mapPage(inner, inner1 -> new ReservationImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountName, billingProfileName); - return Utils.mapPage(inner, inner1 -> new ReservationImpl(inner1, this.manager())); - } - - public PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByBillingProfile( - billingAccountName, billingProfileName, filter, orderby, refreshSummary, selectedState, context); - return Utils.mapPage(inner, inner1 -> new ReservationImpl(inner1, this.manager())); - } - - private ReservationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionImpl.java deleted file mode 100644 index 0727972df9c8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.TransactionInner; -import com.azure.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.Transaction; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import java.time.OffsetDateTime; - -public final class TransactionImpl implements Transaction { - private TransactionInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - TransactionImpl(TransactionInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public TransactionTypeKind kind() { - return this.innerModel().kind(); - } - - public OffsetDateTime date() { - return this.innerModel().date(); - } - - public String invoice() { - return this.innerModel().invoice(); - } - - public String invoiceId() { - return this.innerModel().invoiceId(); - } - - public String orderId() { - return this.innerModel().orderId(); - } - - public String orderName() { - return this.innerModel().orderName(); - } - - public String productFamily() { - return this.innerModel().productFamily(); - } - - public String productTypeId() { - return this.innerModel().productTypeId(); - } - - public String productType() { - return this.innerModel().productType(); - } - - public String productDescription() { - return this.innerModel().productDescription(); - } - - public ReservationType transactionType() { - return this.innerModel().transactionType(); - } - - public Amount transactionAmount() { - return this.innerModel().transactionAmount(); - } - - public Integer quantity() { - return this.innerModel().quantity(); - } - - public String invoiceSectionId() { - return this.innerModel().invoiceSectionId(); - } - - public String invoiceSectionDisplayName() { - return this.innerModel().invoiceSectionDisplayName(); - } - - public String billingProfileId() { - return this.innerModel().billingProfileId(); - } - - public String billingProfileDisplayName() { - return this.innerModel().billingProfileDisplayName(); - } - - public String customerId() { - return this.innerModel().customerId(); - } - - public String customerDisplayName() { - return this.innerModel().customerDisplayName(); - } - - public String subscriptionId() { - return this.innerModel().subscriptionId(); - } - - public String subscriptionName() { - return this.innerModel().subscriptionName(); - } - - public String azurePlan() { - return this.innerModel().azurePlan(); - } - - public Amount azureCreditApplied() { - return this.innerModel().azureCreditApplied(); - } - - public String billingCurrency() { - return this.innerModel().billingCurrency(); - } - - public Float discount() { - return this.innerModel().discount(); - } - - public Amount effectivePrice() { - return this.innerModel().effectivePrice(); - } - - public Float exchangeRate() { - return this.innerModel().exchangeRate(); - } - - public Amount marketPrice() { - return this.innerModel().marketPrice(); - } - - public String pricingCurrency() { - return this.innerModel().pricingCurrency(); - } - - public OffsetDateTime servicePeriodStartDate() { - return this.innerModel().servicePeriodStartDate(); - } - - public OffsetDateTime servicePeriodEndDate() { - return this.innerModel().servicePeriodEndDate(); - } - - public Amount subTotal() { - return this.innerModel().subTotal(); - } - - public Amount tax() { - return this.innerModel().tax(); - } - - public String unitOfMeasure() { - return this.innerModel().unitOfMeasure(); - } - - public Float units() { - return this.innerModel().units(); - } - - public String unitType() { - return this.innerModel().unitType(); - } - - public TransactionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsClientImpl.java deleted file mode 100644 index a9fbee359a79..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsClientImpl.java +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.TransactionsClient; -import com.azure.resourcemanager.billing.fluent.models.TransactionInner; -import com.azure.resourcemanager.billing.models.TransactionListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TransactionsClient. */ -public final class TransactionsClientImpl implements TransactionsClient { - private final ClientLogger logger = new ClientLogger(TransactionsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final TransactionsService service; - - /** The service client containing this operation class. */ - private final BillingManagementClientImpl client; - - /** - * Initializes an instance of TransactionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TransactionsClientImpl(BillingManagementClientImpl client) { - this.service = - RestProxy.create(TransactionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for BillingManagementClientTransactions to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "BillingManagementCli") - private interface TransactionsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/transactions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoice( - @HostParam("$host") String endpoint, - @PathParam("billingAccountName") String billingAccountName, - @PathParam("invoiceName") String invoiceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByInvoiceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSinglePageAsync( - String billingAccountName, String invoiceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByInvoice( - this.client.getEndpoint(), billingAccountName, invoiceName, apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceSinglePageAsync( - String billingAccountName, String invoiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (billingAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.")); - } - if (invoiceName == null) { - return Mono.error(new IllegalArgumentException("Parameter invoiceName is required and cannot be null.")); - } - final String apiVersion = "2020-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoice(this.client.getEndpoint(), billingAccountName, invoiceName, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceAsync(String billingAccountName, String invoiceName) { - return new PagedFlux<>( - () -> listByInvoiceSinglePageAsync(billingAccountName, invoiceName), - nextLink -> listByInvoiceNextSinglePageAsync(nextLink)); - } - - /** - * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByInvoiceAsync( - String billingAccountName, String invoiceName, Context context) { - return new PagedFlux<>( - () -> listByInvoiceSinglePageAsync(billingAccountName, invoiceName, context), - nextLink -> listByInvoiceNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoice(String billingAccountName, String invoiceName) { - return new PagedIterable<>(listByInvoiceAsync(billingAccountName, invoiceName)); - } - - /** - * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByInvoice( - String billingAccountName, String invoiceName, Context context) { - return new PagedIterable<>(listByInvoiceAsync(billingAccountName, invoiceName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByInvoiceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByInvoiceNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByInvoiceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsImpl.java deleted file mode 100644 index 5d505fc21058..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.TransactionsClient; -import com.azure.resourcemanager.billing.fluent.models.TransactionInner; -import com.azure.resourcemanager.billing.models.Transaction; -import com.azure.resourcemanager.billing.models.Transactions; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class TransactionsImpl implements Transactions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransactionsImpl.class); - - private final TransactionsClient innerClient; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - public TransactionsImpl( - TransactionsClient innerClient, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByInvoice(String billingAccountName, String invoiceName) { - PagedIterable inner = this.serviceClient().listByInvoice(billingAccountName, invoiceName); - return Utils.mapPage(inner, inner1 -> new TransactionImpl(inner1, this.manager())); - } - - public PagedIterable listByInvoice(String billingAccountName, String invoiceName, Context context) { - PagedIterable inner = - this.serviceClient().listByInvoice(billingAccountName, invoiceName, context); - return Utils.mapPage(inner, inner1 -> new TransactionImpl(inner1, this.manager())); - } - - private TransactionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/Utils.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/Utils.java deleted file mode 100644 index 0105faff013d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/Utils.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class Utils { - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateAddressResponseImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateAddressResponseImpl.java deleted file mode 100644 index fc38d1c46bdd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateAddressResponseImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.ValidateAddressResponseInner; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.AddressValidationStatus; -import com.azure.resourcemanager.billing.models.ValidateAddressResponse; -import java.util.Collections; -import java.util.List; - -public final class ValidateAddressResponseImpl implements ValidateAddressResponse { - private ValidateAddressResponseInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - ValidateAddressResponseImpl( - ValidateAddressResponseInner innerObject, com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public AddressValidationStatus status() { - return this.innerModel().status(); - } - - public List suggestedAddresses() { - List inner = this.innerModel().suggestedAddresses(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String validationMessage() { - return this.innerModel().validationMessage(); - } - - public ValidateAddressResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateProductTransferEligibilityResultImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateProductTransferEligibilityResultImpl.java deleted file mode 100644 index 294dfa24f0f7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateProductTransferEligibilityResultImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.ValidateProductTransferEligibilityResultInner; -import com.azure.resourcemanager.billing.models.ValidateProductTransferEligibilityError; -import com.azure.resourcemanager.billing.models.ValidateProductTransferEligibilityResult; - -public final class ValidateProductTransferEligibilityResultImpl implements ValidateProductTransferEligibilityResult { - private ValidateProductTransferEligibilityResultInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - ValidateProductTransferEligibilityResultImpl( - ValidateProductTransferEligibilityResultInner innerObject, - com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Boolean isMoveEligible() { - return this.innerModel().isMoveEligible(); - } - - public ValidateProductTransferEligibilityError errorDetails() { - return this.innerModel().errorDetails(); - } - - public ValidateProductTransferEligibilityResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateSubscriptionTransferEligibilityResultImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateSubscriptionTransferEligibilityResultImpl.java deleted file mode 100644 index de1a9d101689..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ValidateSubscriptionTransferEligibilityResultImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.implementation; - -import com.azure.resourcemanager.billing.fluent.models.ValidateSubscriptionTransferEligibilityResultInner; -import com.azure.resourcemanager.billing.models.ValidateSubscriptionTransferEligibilityError; -import com.azure.resourcemanager.billing.models.ValidateSubscriptionTransferEligibilityResult; - -public final class ValidateSubscriptionTransferEligibilityResultImpl - implements ValidateSubscriptionTransferEligibilityResult { - private ValidateSubscriptionTransferEligibilityResultInner innerObject; - - private final com.azure.resourcemanager.billing.BillingManager serviceManager; - - ValidateSubscriptionTransferEligibilityResultImpl( - ValidateSubscriptionTransferEligibilityResultInner innerObject, - com.azure.resourcemanager.billing.BillingManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Boolean isMoveEligible() { - return this.innerModel().isMoveEligible(); - } - - public ValidateSubscriptionTransferEligibilityError errorDetails() { - return this.innerModel().errorDetails(); - } - - public ValidateSubscriptionTransferEligibilityResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.billing.BillingManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/package-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/package-info.java deleted file mode 100644 index 067b2a6a57cc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the implementations for BillingManagementClient. Billing client provides access to billing - * resources for Azure subscriptions. - */ -package com.azure.resourcemanager.billing.implementation; diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AcceptanceMode.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AcceptanceMode.java deleted file mode 100644 index 107241a07f01..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AcceptanceMode.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AcceptanceMode. */ -public final class AcceptanceMode extends ExpandableStringEnum { - /** Static value ClickToAccept for AcceptanceMode. */ - public static final AcceptanceMode CLICK_TO_ACCEPT = fromString("ClickToAccept"); - - /** Static value ESignEmbedded for AcceptanceMode. */ - public static final AcceptanceMode ESIGN_EMBEDDED = fromString("ESignEmbedded"); - - /** Static value ESignOffline for AcceptanceMode. */ - public static final AcceptanceMode ESIGN_OFFLINE = fromString("ESignOffline"); - - /** - * Creates or finds a AcceptanceMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding AcceptanceMode. - */ - @JsonCreator - public static AcceptanceMode fromString(String name) { - return fromString(name, AcceptanceMode.class); - } - - /** @return known AcceptanceMode values. */ - public static Collection values() { - return values(AcceptanceMode.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AccountStatus.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AccountStatus.java deleted file mode 100644 index 2ad647f69cfc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AccountStatus.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AccountStatus. */ -public final class AccountStatus extends ExpandableStringEnum { - /** Static value Active for AccountStatus. */ - public static final AccountStatus ACTIVE = fromString("Active"); - - /** Static value Deleted for AccountStatus. */ - public static final AccountStatus DELETED = fromString("Deleted"); - - /** Static value Disabled for AccountStatus. */ - public static final AccountStatus DISABLED = fromString("Disabled"); - - /** Static value Expired for AccountStatus. */ - public static final AccountStatus EXPIRED = fromString("Expired"); - - /** Static value Transferred for AccountStatus. */ - public static final AccountStatus TRANSFERRED = fromString("Transferred"); - - /** Static value Extended for AccountStatus. */ - public static final AccountStatus EXTENDED = fromString("Extended"); - - /** Static value Terminated for AccountStatus. */ - public static final AccountStatus TERMINATED = fromString("Terminated"); - - /** - * Creates or finds a AccountStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding AccountStatus. - */ - @JsonCreator - public static AccountStatus fromString(String name) { - return fromString(name, AccountStatus.class); - } - - /** @return known AccountStatus values. */ - public static Collection values() { - return values(AccountStatus.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AccountType.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AccountType.java deleted file mode 100644 index 5262257801eb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AccountType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AccountType. */ -public final class AccountType extends ExpandableStringEnum { - /** Static value Enterprise for AccountType. */ - public static final AccountType ENTERPRISE = fromString("Enterprise"); - - /** Static value Individual for AccountType. */ - public static final AccountType INDIVIDUAL = fromString("Individual"); - - /** Static value Partner for AccountType. */ - public static final AccountType PARTNER = fromString("Partner"); - - /** - * Creates or finds a AccountType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AccountType. - */ - @JsonCreator - public static AccountType fromString(String name) { - return fromString(name, AccountType.class); - } - - /** @return known AccountType values. */ - public static Collection values() { - return values(AccountType.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Address.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Address.java deleted file mode 100644 index b050b59356ac..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Address.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Address. */ -public interface Address { - /** - * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * - * @param address Address details. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the address validation. - */ - ValidateAddressResponse validate(AddressDetails address); - - /** - * Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address. - * - * @param address Address details. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the address validation. - */ - Response validateWithResponse(AddressDetails address, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressDetails.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressDetails.java deleted file mode 100644 index 1bac18f0a50c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressDetails.java +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Address details. */ -@Fluent -public final class AddressDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressDetails.class); - - /* - * First name. - */ - @JsonProperty(value = "firstName") - private String firstName; - - /* - * Middle name. - */ - @JsonProperty(value = "middleName") - private String middleName; - - /* - * Last name. - */ - @JsonProperty(value = "lastName") - private String lastName; - - /* - * Company name. - */ - @JsonProperty(value = "companyName") - private String companyName; - - /* - * Address line 1. - */ - @JsonProperty(value = "addressLine1", required = true) - private String addressLine1; - - /* - * Address line 2. - */ - @JsonProperty(value = "addressLine2") - private String addressLine2; - - /* - * Address line 3. - */ - @JsonProperty(value = "addressLine3") - private String addressLine3; - - /* - * Address city. - */ - @JsonProperty(value = "city") - private String city; - - /* - * Address district. - */ - @JsonProperty(value = "district") - private String district; - - /* - * Address region. - */ - @JsonProperty(value = "region") - private String region; - - /* - * Country code uses ISO2, 2-digit format. - */ - @JsonProperty(value = "country", required = true) - private String country; - - /* - * Postal code. - */ - @JsonProperty(value = "postalCode") - private String postalCode; - - /* - * Email address. - */ - @JsonProperty(value = "email") - private String email; - - /* - * Phone number. - */ - @JsonProperty(value = "phoneNumber") - private String phoneNumber; - - /** - * Get the firstName property: First name. - * - * @return the firstName value. - */ - public String firstName() { - return this.firstName; - } - - /** - * Set the firstName property: First name. - * - * @param firstName the firstName value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withFirstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get the middleName property: Middle name. - * - * @return the middleName value. - */ - public String middleName() { - return this.middleName; - } - - /** - * Set the middleName property: Middle name. - * - * @param middleName the middleName value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withMiddleName(String middleName) { - this.middleName = middleName; - return this; - } - - /** - * Get the lastName property: Last name. - * - * @return the lastName value. - */ - public String lastName() { - return this.lastName; - } - - /** - * Set the lastName property: Last name. - * - * @param lastName the lastName value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withLastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get the companyName property: Company name. - * - * @return the companyName value. - */ - public String companyName() { - return this.companyName; - } - - /** - * Set the companyName property: Company name. - * - * @param companyName the companyName value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withCompanyName(String companyName) { - this.companyName = companyName; - return this; - } - - /** - * Get the addressLine1 property: Address line 1. - * - * @return the addressLine1 value. - */ - public String addressLine1() { - return this.addressLine1; - } - - /** - * Set the addressLine1 property: Address line 1. - * - * @param addressLine1 the addressLine1 value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withAddressLine1(String addressLine1) { - this.addressLine1 = addressLine1; - return this; - } - - /** - * Get the addressLine2 property: Address line 2. - * - * @return the addressLine2 value. - */ - public String addressLine2() { - return this.addressLine2; - } - - /** - * Set the addressLine2 property: Address line 2. - * - * @param addressLine2 the addressLine2 value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withAddressLine2(String addressLine2) { - this.addressLine2 = addressLine2; - return this; - } - - /** - * Get the addressLine3 property: Address line 3. - * - * @return the addressLine3 value. - */ - public String addressLine3() { - return this.addressLine3; - } - - /** - * Set the addressLine3 property: Address line 3. - * - * @param addressLine3 the addressLine3 value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withAddressLine3(String addressLine3) { - this.addressLine3 = addressLine3; - return this; - } - - /** - * Get the city property: Address city. - * - * @return the city value. - */ - public String city() { - return this.city; - } - - /** - * Set the city property: Address city. - * - * @param city the city value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withCity(String city) { - this.city = city; - return this; - } - - /** - * Get the district property: Address district. - * - * @return the district value. - */ - public String district() { - return this.district; - } - - /** - * Set the district property: Address district. - * - * @param district the district value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withDistrict(String district) { - this.district = district; - return this; - } - - /** - * Get the region property: Address region. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Set the region property: Address region. - * - * @param region the region value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withRegion(String region) { - this.region = region; - return this; - } - - /** - * Get the country property: Country code uses ISO2, 2-digit format. - * - * @return the country value. - */ - public String country() { - return this.country; - } - - /** - * Set the country property: Country code uses ISO2, 2-digit format. - * - * @param country the country value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withCountry(String country) { - this.country = country; - return this; - } - - /** - * Get the postalCode property: Postal code. - * - * @return the postalCode value. - */ - public String postalCode() { - return this.postalCode; - } - - /** - * Set the postalCode property: Postal code. - * - * @param postalCode the postalCode value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withPostalCode(String postalCode) { - this.postalCode = postalCode; - return this; - } - - /** - * Get the email property: Email address. - * - * @return the email value. - */ - public String email() { - return this.email; - } - - /** - * Set the email property: Email address. - * - * @param email the email value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withEmail(String email) { - this.email = email; - return this; - } - - /** - * Get the phoneNumber property: Phone number. - * - * @return the phoneNumber value. - */ - public String phoneNumber() { - return this.phoneNumber; - } - - /** - * Set the phoneNumber property: Phone number. - * - * @param phoneNumber the phoneNumber value to set. - * @return the AddressDetails object itself. - */ - public AddressDetails withPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (addressLine1() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property addressLine1 in model AddressDetails")); - } - if (country() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property country in model AddressDetails")); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressValidationStatus.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressValidationStatus.java deleted file mode 100644 index f01461a54618..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressValidationStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AddressValidationStatus. */ -public final class AddressValidationStatus extends ExpandableStringEnum { - /** Static value Valid for AddressValidationStatus. */ - public static final AddressValidationStatus VALID = fromString("Valid"); - - /** Static value Invalid for AddressValidationStatus. */ - public static final AddressValidationStatus INVALID = fromString("Invalid"); - - /** - * Creates or finds a AddressValidationStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding AddressValidationStatus. - */ - @JsonCreator - public static AddressValidationStatus fromString(String name) { - return fromString(name, AddressValidationStatus.class); - } - - /** @return known AddressValidationStatus values. */ - public static Collection values() { - return values(AddressValidationStatus.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreement.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreement.java deleted file mode 100644 index e6a183f3a8f5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreement.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.AgreementInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of Agreement. */ -public interface Agreement { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the agreementLink property: The URL to download the agreement. - * - * @return the agreementLink value. - */ - String agreementLink(); - - /** - * Gets the category property: The category of the agreement signed by a customer. - * - * @return the category value. - */ - Category category(); - - /** - * Gets the acceptanceMode property: The mode of acceptance for an agreement. - * - * @return the acceptanceMode value. - */ - AcceptanceMode acceptanceMode(); - - /** - * Gets the effectiveDate property: The date from which the agreement is effective. - * - * @return the effectiveDate value. - */ - OffsetDateTime effectiveDate(); - - /** - * Gets the expirationDate property: The date when the agreement expires. - * - * @return the expirationDate value. - */ - OffsetDateTime expirationDate(); - - /** - * Gets the participants property: The list of participants that participates in acceptance of an agreement. - * - * @return the participants value. - */ - List participants(); - - /** - * Gets the status property: The current status of the agreement. - * - * @return the status value. - */ - String status(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.AgreementInner object. - * - * @return the inner object. - */ - AgreementInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementListResult.java deleted file mode 100644 index 211b66737c84..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.AgreementInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of listing agreements. */ -@Immutable -public final class AgreementListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AgreementListResult.class); - - /* - * The list of agreements. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of agreements. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementType.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementType.java deleted file mode 100644 index 4629aaa50fd0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AgreementType. */ -public final class AgreementType extends ExpandableStringEnum { - /** Static value MicrosoftCustomerAgreement for AgreementType. */ - public static final AgreementType MICROSOFT_CUSTOMER_AGREEMENT = fromString("MicrosoftCustomerAgreement"); - - /** Static value EnterpriseAgreement for AgreementType. */ - public static final AgreementType ENTERPRISE_AGREEMENT = fromString("EnterpriseAgreement"); - - /** Static value MicrosoftOnlineServicesProgram for AgreementType. */ - public static final AgreementType MICROSOFT_ONLINE_SERVICES_PROGRAM = fromString("MicrosoftOnlineServicesProgram"); - - /** Static value MicrosoftPartnerAgreement for AgreementType. */ - public static final AgreementType MICROSOFT_PARTNER_AGREEMENT = fromString("MicrosoftPartnerAgreement"); - - /** - * Creates or finds a AgreementType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AgreementType. - */ - @JsonCreator - public static AgreementType fromString(String name) { - return fromString(name, AgreementType.class); - } - - /** @return known AgreementType values. */ - public static Collection values() { - return values(AgreementType.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreements.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreements.java deleted file mode 100644 index 1585663af468..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreements.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Agreements. */ -public interface Agreements { - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the agreements for a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the participants. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing agreements. - */ - PagedIterable listByBillingAccount(String billingAccountName, String expand, Context context); - - /** - * Gets an agreement by ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agreement by ID. - */ - Agreement get(String billingAccountName, String agreementName); - - /** - * Gets an agreement by ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param agreementName The ID that uniquely identifies an agreement. - * @param expand May be used to expand the participants. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agreement by ID. - */ - Response getWithResponse( - String billingAccountName, String agreementName, String expand, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Amount.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Amount.java deleted file mode 100644 index e835dfc0d8f7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Amount.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The amount. */ -@Fluent -public final class Amount { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Amount.class); - - /* - * The currency for the amount value. - */ - @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; - - /* - * Amount value. - */ - @JsonProperty(value = "value") - private Float value; - - /** - * Get the currency property: The currency for the amount value. - * - * @return the currency value. - */ - public String currency() { - return this.currency; - } - - /** - * Get the value property: Amount value. - * - * @return the value value. - */ - public Float value() { - return this.value; - } - - /** - * Set the value property: Amount value. - * - * @param value the value value to set. - * @return the Amount object itself. - */ - public Amount withValue(Float value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AutoRenew.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AutoRenew.java deleted file mode 100644 index 4cde432a75d3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AutoRenew.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AutoRenew. */ -public final class AutoRenew extends ExpandableStringEnum { - /** Static value Off for AutoRenew. */ - public static final AutoRenew OFF = fromString("Off"); - - /** Static value On for AutoRenew. */ - public static final AutoRenew ON = fromString("On"); - - /** - * Creates or finds a AutoRenew from its string representation. - * - * @param name a name to look for. - * @return the corresponding AutoRenew. - */ - @JsonCreator - public static AutoRenew fromString(String name) { - return fromString(name, AutoRenew.class); - } - - /** @return known AutoRenew values. */ - public static Collection values() { - return values(AutoRenew.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AvailableBalance.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AvailableBalance.java deleted file mode 100644 index 78bbb1e705d5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AvailableBalance.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner; - -/** An immutable client-side representation of AvailableBalance. */ -public interface AvailableBalance { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the amount property: Balance amount. - * - * @return the amount value. - */ - Amount amount(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner object. - * - * @return the inner object. - */ - AvailableBalanceInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AvailableBalances.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AvailableBalances.java deleted file mode 100644 index db3cb67b29bb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AvailableBalances.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of AvailableBalances. */ -public interface AvailableBalances { - /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now to settle - * due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the latest Azure credit balance. - */ - AvailableBalance get(String billingAccountName, String billingProfileName); - - /** - * The available credit balance for a billing profile. This is the balance that can be used for pay now to settle - * due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the latest Azure credit balance. - */ - Response getWithResponse(String billingAccountName, String billingProfileName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AzurePlan.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AzurePlan.java deleted file mode 100644 index afd025f54c73..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AzurePlan.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Details of the Azure plan. */ -@Fluent -public final class AzurePlan { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzurePlan.class); - - /* - * The sku id. - */ - @JsonProperty(value = "skuId") - private String skuId; - - /* - * The sku description. - */ - @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) - private String skuDescription; - - /** - * Get the skuId property: The sku id. - * - * @return the skuId value. - */ - public String skuId() { - return this.skuId; - } - - /** - * Set the skuId property: The sku id. - * - * @param skuId the skuId value to set. - * @return the AzurePlan object itself. - */ - public AzurePlan withSkuId(String skuId) { - this.skuId = skuId; - return this; - } - - /** - * Get the skuDescription property: The sku description. - * - * @return the skuDescription value. - */ - public String skuDescription() { - return this.skuDescription; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccount.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccount.java deleted file mode 100644 index 0a4275710e0d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccount.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.BillingAccountInner; -import java.util.List; - -/** An immutable client-side representation of BillingAccount. */ -public interface BillingAccount { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the displayName property: The billing account name. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @return the soldTo value. - */ - AddressDetails soldTo(); - - /** - * Gets the agreementType property: The type of agreement. - * - * @return the agreementType value. - */ - AgreementType agreementType(); - - /** - * Gets the accountType property: The type of customer. - * - * @return the accountType value. - */ - AccountType accountType(); - - /** - * Gets the accountStatus property: The current status of the billing account. - * - * @return the accountStatus value. - */ - AccountStatus accountStatus(); - - /** - * Gets the billingProfiles property: The billing profiles associated with the billing account. By default this is - * not populated, unless it's specified in $expand. - * - * @return the billingProfiles value. - */ - BillingProfilesOnExpand billingProfiles(); - - /** - * Gets the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not - * populated, unless it's specified in $expand. - * - * @return the enrollmentDetails value. - */ - Enrollment enrollmentDetails(); - - /** - * Gets the departments property: The departments associated to the enrollment. - * - * @return the departments value. - */ - List departments(); - - /** - * Gets the enrollmentAccounts property: The accounts associated to the enrollment. - * - * @return the enrollmentAccounts value. - */ - List enrollmentAccounts(); - - /** - * Gets the hasReadAccess property: Indicates whether user has read access to the billing account. - * - * @return the hasReadAccess value. - */ - Boolean hasReadAccess(); - - /** - * Gets the notificationEmailAddress property: Notification email address, only for legacy accounts. - * - * @return the notificationEmailAddress value. - */ - String notificationEmailAddress(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingAccountInner object. - * - * @return the inner object. - */ - BillingAccountInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountListResult.java deleted file mode 100644 index 1e4830e58ee3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.BillingAccountInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of billing accounts. */ -@Immutable -public final class BillingAccountListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingAccountListResult.class); - - /* - * The list of billing accounts. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of billing accounts. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountUpdateRequest.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountUpdateRequest.java deleted file mode 100644 index acb97373c28d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccountUpdateRequest.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.BillingAccountProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The request properties of the billing account that can be updated. */ -@Fluent -public final class BillingAccountUpdateRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingAccountUpdateRequest.class); - - /* - * A billing property. - */ - @JsonProperty(value = "properties") - private BillingAccountProperties innerProperties; - - /** - * Get the innerProperties property: A billing property. - * - * @return the innerProperties value. - */ - private BillingAccountProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: The billing account name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The billing account name. - * - * @param displayName the displayName value to set. - * @return the BillingAccountUpdateRequest object itself. - */ - public BillingAccountUpdateRequest withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @return the soldTo value. - */ - public AddressDetails soldTo() { - return this.innerProperties() == null ? null : this.innerProperties().soldTo(); - } - - /** - * Set the soldTo property: The address of the individual or organization that is responsible for the billing - * account. - * - * @param soldTo the soldTo value to set. - * @return the BillingAccountUpdateRequest object itself. - */ - public BillingAccountUpdateRequest withSoldTo(AddressDetails soldTo) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withSoldTo(soldTo); - return this; - } - - /** - * Get the agreementType property: The type of agreement. - * - * @return the agreementType value. - */ - public AgreementType agreementType() { - return this.innerProperties() == null ? null : this.innerProperties().agreementType(); - } - - /** - * Get the accountType property: The type of customer. - * - * @return the accountType value. - */ - public AccountType accountType() { - return this.innerProperties() == null ? null : this.innerProperties().accountType(); - } - - /** - * Get the accountStatus property: The current status of the billing account. - * - * @return the accountStatus value. - */ - public AccountStatus accountStatus() { - return this.innerProperties() == null ? null : this.innerProperties().accountStatus(); - } - - /** - * Get the billingProfiles property: The billing profiles associated with the billing account. By default this is - * not populated, unless it's specified in $expand. - * - * @return the billingProfiles value. - */ - public BillingProfilesOnExpand billingProfiles() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfiles(); - } - - /** - * Set the billingProfiles property: The billing profiles associated with the billing account. By default this is - * not populated, unless it's specified in $expand. - * - * @param billingProfiles the billingProfiles value to set. - * @return the BillingAccountUpdateRequest object itself. - */ - public BillingAccountUpdateRequest withBillingProfiles(BillingProfilesOnExpand billingProfiles) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withBillingProfiles(billingProfiles); - return this; - } - - /** - * Get the enrollmentDetails property: The details about the associated legacy enrollment. By default this is not - * populated, unless it's specified in $expand. - * - * @return the enrollmentDetails value. - */ - public Enrollment enrollmentDetails() { - return this.innerProperties() == null ? null : this.innerProperties().enrollmentDetails(); - } - - /** - * Get the departments property: The departments associated to the enrollment. - * - * @return the departments value. - */ - public List departments() { - return this.innerProperties() == null ? null : this.innerProperties().departments(); - } - - /** - * Set the departments property: The departments associated to the enrollment. - * - * @param departments the departments value to set. - * @return the BillingAccountUpdateRequest object itself. - */ - public BillingAccountUpdateRequest withDepartments(List departments) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withDepartments(departments); - return this; - } - - /** - * Get the enrollmentAccounts property: The accounts associated to the enrollment. - * - * @return the enrollmentAccounts value. - */ - public List enrollmentAccounts() { - return this.innerProperties() == null ? null : this.innerProperties().enrollmentAccounts(); - } - - /** - * Set the enrollmentAccounts property: The accounts associated to the enrollment. - * - * @param enrollmentAccounts the enrollmentAccounts value to set. - * @return the BillingAccountUpdateRequest object itself. - */ - public BillingAccountUpdateRequest withEnrollmentAccounts(List enrollmentAccounts) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withEnrollmentAccounts(enrollmentAccounts); - return this; - } - - /** - * Get the hasReadAccess property: Indicates whether user has read access to the billing account. - * - * @return the hasReadAccess value. - */ - public Boolean hasReadAccess() { - return this.innerProperties() == null ? null : this.innerProperties().hasReadAccess(); - } - - /** - * Get the notificationEmailAddress property: Notification email address, only for legacy accounts. - * - * @return the notificationEmailAddress value. - */ - public String notificationEmailAddress() { - return this.innerProperties() == null ? null : this.innerProperties().notificationEmailAddress(); - } - - /** - * Set the notificationEmailAddress property: Notification email address, only for legacy accounts. - * - * @param notificationEmailAddress the notificationEmailAddress value to set. - * @return the BillingAccountUpdateRequest object itself. - */ - public BillingAccountUpdateRequest withNotificationEmailAddress(String notificationEmailAddress) { - if (this.innerProperties() == null) { - this.innerProperties = new BillingAccountProperties(); - } - this.innerProperties().withNotificationEmailAddress(notificationEmailAddress); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccounts.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccounts.java deleted file mode 100644 index fbfbd069beed..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccounts.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of BillingAccounts. */ -public interface BillingAccounts { - /** - * Lists the billing accounts that a user has access to. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - PagedIterable list(); - - /** - * Lists the billing accounts that a user has access to. - * - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing accounts. - */ - PagedIterable list(String expand, Context context); - - /** - * Gets a billing account by its ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account by its ID. - */ - BillingAccount get(String billingAccountName); - - /** - * Gets a billing account by its ID. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the soldTo, invoice sections and billing profiles. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account by its ID. - */ - Response getWithResponse(String billingAccountName, String expand, Context context); - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - BillingAccount update(String billingAccountName, BillingAccountUpdateRequest parameters); - - /** - * Updates the properties of a billing account. Currently, displayName and address can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing account operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing account. - */ - BillingAccount update(String billingAccountName, BillingAccountUpdateRequest parameters, Context context); - - /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - PagedIterable listInvoiceSectionsByCreateSubscriptionPermission( - String billingAccountName); - - /** - * Lists the invoice sections for which the user has permission to create Azure subscriptions. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice section properties with create subscription permission. - */ - PagedIterable listInvoiceSectionsByCreateSubscriptionPermission( - String billingAccountName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingFrequency.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingFrequency.java deleted file mode 100644 index 3bc102e7aa56..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingFrequency.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BillingFrequency. */ -public final class BillingFrequency extends ExpandableStringEnum { - /** Static value OneTime for BillingFrequency. */ - public static final BillingFrequency ONE_TIME = fromString("OneTime"); - - /** Static value Monthly for BillingFrequency. */ - public static final BillingFrequency MONTHLY = fromString("Monthly"); - - /** Static value UsageBased for BillingFrequency. */ - public static final BillingFrequency USAGE_BASED = fromString("UsageBased"); - - /** - * Creates or finds a BillingFrequency from its string representation. - * - * @param name a name to look for. - * @return the corresponding BillingFrequency. - */ - @JsonCreator - public static BillingFrequency fromString(String name) { - return fromString(name, BillingFrequency.class); - } - - /** @return known BillingFrequency values. */ - public static Collection values() { - return values(BillingFrequency.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriod.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriod.java deleted file mode 100644 index ba9aaa0314b7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriod.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; -import java.time.LocalDate; -import java.util.List; - -/** An immutable client-side representation of BillingPeriod. */ -public interface BillingPeriod { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the billingPeriodStartDate property: The start of the date range covered by the billing period. - * - * @return the billingPeriodStartDate value. - */ - LocalDate billingPeriodStartDate(); - - /** - * Gets the billingPeriodEndDate property: The end of the date range covered by the billing period. - * - * @return the billingPeriodEndDate value. - */ - LocalDate billingPeriodEndDate(); - - /** - * Gets the invoiceIds property: Array of invoice ids that associated with. - * - * @return the invoiceIds value. - */ - List invoiceIds(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner object. - * - * @return the inner object. - */ - BillingPeriodInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriods.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriods.java deleted file mode 100644 index e2b820043aa7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriods.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of BillingPeriods. */ -public interface BillingPeriods { - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - PagedIterable list(); - - /** - * Lists the available billing periods for a subscription in reverse chronological order. This is only supported for - * Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web - * portal are not supported through this preview API. - * - * @param filter May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', - * 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the most recent N billing periods. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing billing periods. - */ - PagedIterable list(String filter, String skiptoken, Integer top, Context context); - - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types - * which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @param billingPeriodName The name of a BillingPeriod resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - BillingPeriod get(String billingPeriodName); - - /** - * Gets a named billing period. This is only supported for Azure Web-Direct subscriptions. Other subscription types - * which were not purchased directly through the Azure web portal are not supported through this preview API. - * - * @param billingPeriodName The name of a BillingPeriod resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a named billing period. - */ - Response getWithResponse(String billingPeriodName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriodsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriodsListResult.java deleted file mode 100644 index eb1b669895b8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPeriodsListResult.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of listing billing periods. It contains a list of available billing periods in reverse chronological order. - */ -@Immutable -public final class BillingPeriodsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingPeriodsListResult.class); - - /* - * The list of billing periods. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of billing periods. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissions.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissions.java deleted file mode 100644 index d77726f5684d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissions.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of BillingPermissions. */ -public interface BillingPermissions { - /** - * Lists the billing permissions the caller has for a customer. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - PagedIterable listByCustomer(String billingAccountName, String customerName); - - /** - * Lists the billing permissions the caller has for a customer. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - PagedIterable listByCustomer( - String billingAccountName, String customerName, Context context); - - /** - * Lists the billing permissions the caller has on a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the billing permissions the caller has on a billing account. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - PagedIterable listByBillingAccount(String billingAccountName, Context context); - - /** - * Lists the billing permissions the caller has on an invoice section. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - PagedIterable listByInvoiceSections( - String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Lists the billing permissions the caller has on an invoice section. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - PagedIterable listByInvoiceSections( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); - - /** - * Lists the billing permissions the caller has on a billing profile. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName); - - /** - * Lists the billing permissions the caller has on a billing profile. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of list billingPermissions a caller has on a billing account. - */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissionsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissionsListResult.java deleted file mode 100644 index b33bb19f409e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissionsListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of list billingPermissions a caller has on a billing account. */ -@Immutable -public final class BillingPermissionsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingPermissionsListResult.class); - - /* - * The list of billingPermissions a caller has on a billing account. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of billingPermissions a caller has on a billing account. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissionsProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissionsProperties.java deleted file mode 100644 index 0c19fdaf8542..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissionsProperties.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import java.util.List; - -/** An immutable client-side representation of BillingPermissionsProperties. */ -public interface BillingPermissionsProperties { - /** - * Gets the actions property: The set of actions that the caller is allowed to perform. - * - * @return the actions value. - */ - List actions(); - - /** - * Gets the notActions property: The set of actions that the caller is not allowed to perform. - * - * @return the notActions value. - */ - List notActions(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner object. - * - * @return the inner object. - */ - BillingPermissionsPropertiesInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfile.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfile.java deleted file mode 100644 index fb9d355d5ade..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfile.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of BillingProfile. */ -public interface BillingProfile { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the displayName property: The name of the billing profile. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the poNumber property: The purchase order name that will appear on the invoices generated for the billing - * profile. - * - * @return the poNumber value. - */ - String poNumber(); - - /** - * Gets the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile. - * - * @return the billingRelationshipType value. - */ - BillingRelationshipType billingRelationshipType(); - - /** - * Gets the billTo property: Billing address. - * - * @return the billTo value. - */ - AddressDetails billTo(); - - /** - * Gets the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing - * profile in indirect purchase motion. - * - * @return the indirectRelationshipInfo value. - */ - IndirectRelationshipInfo indirectRelationshipInfo(); - - /** - * Gets the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent - * through email. - * - * @return the invoiceEmailOptIn value. - */ - Boolean invoiceEmailOptIn(); - - /** - * Gets the invoiceDay property: The day of the month when the invoice for the billing profile is generated. - * - * @return the invoiceDay value. - */ - Integer invoiceDay(); - - /** - * Gets the currency property: The currency in which the charges for the billing profile are billed. - * - * @return the currency value. - */ - String currency(); - - /** - * Gets the enabledAzurePlans property: Information about the enabled azure plans. - * - * @return the enabledAzurePlans value. - */ - List enabledAzurePlans(); - - /** - * Gets the invoiceSections property: The invoice sections associated to the billing profile. By default this is not - * populated, unless it's specified in $expand. - * - * @return the invoiceSections value. - */ - InvoiceSectionsOnExpand invoiceSections(); - - /** - * Gets the hasReadAccess property: Indicates whether user has read access to the billing profile. - * - * @return the hasReadAccess value. - */ - Boolean hasReadAccess(); - - /** - * Gets the systemId property: The system generated unique identifier for a billing profile. - * - * @return the systemId value. - */ - String systemId(); - - /** - * Gets the status property: The status of the billing profile. - * - * @return the status value. - */ - BillingProfileStatus status(); - - /** - * Gets the statusReasonCode property: Reason for the specified billing profile status. - * - * @return the statusReasonCode value. - */ - StatusReasonCode statusReasonCode(); - - /** - * Gets the spendingLimit property: The billing profile spending limit. - * - * @return the spendingLimit value. - */ - SpendingLimit spendingLimit(); - - /** - * Gets the targetClouds property: Identifies the cloud environments that are associated with a billing profile. - * This is a system managed optional field and gets updated as the billing profile gets associated with accounts in - * various clouds. - * - * @return the targetClouds value. - */ - List targetClouds(); - - /** - * Gets the tags property: Tags of billing profiles. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingProfileInner object. - * - * @return the inner object. - */ - BillingProfileInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileListResult.java deleted file mode 100644 index d04b645306ba..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of billing profiles. */ -@Immutable -public final class BillingProfileListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingProfileListResult.class); - - /* - * The list of billing profiles. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of billing profiles. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileSpendingLimit.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileSpendingLimit.java deleted file mode 100644 index 63e71f62c514..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileSpendingLimit.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BillingProfileSpendingLimit. */ -public final class BillingProfileSpendingLimit extends ExpandableStringEnum { - /** Static value Off for BillingProfileSpendingLimit. */ - public static final BillingProfileSpendingLimit OFF = fromString("Off"); - - /** Static value On for BillingProfileSpendingLimit. */ - public static final BillingProfileSpendingLimit ON = fromString("On"); - - /** - * Creates or finds a BillingProfileSpendingLimit from its string representation. - * - * @param name a name to look for. - * @return the corresponding BillingProfileSpendingLimit. - */ - @JsonCreator - public static BillingProfileSpendingLimit fromString(String name) { - return fromString(name, BillingProfileSpendingLimit.class); - } - - /** @return known BillingProfileSpendingLimit values. */ - public static Collection values() { - return values(BillingProfileSpendingLimit.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileStatus.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileStatus.java deleted file mode 100644 index d6c08a809115..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileStatus.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BillingProfileStatus. */ -public final class BillingProfileStatus extends ExpandableStringEnum { - /** Static value Active for BillingProfileStatus. */ - public static final BillingProfileStatus ACTIVE = fromString("Active"); - - /** Static value Disabled for BillingProfileStatus. */ - public static final BillingProfileStatus DISABLED = fromString("Disabled"); - - /** Static value Warned for BillingProfileStatus. */ - public static final BillingProfileStatus WARNED = fromString("Warned"); - - /** - * Creates or finds a BillingProfileStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding BillingProfileStatus. - */ - @JsonCreator - public static BillingProfileStatus fromString(String name) { - return fromString(name, BillingProfileStatus.class); - } - - /** @return known BillingProfileStatus values. */ - public static Collection values() { - return values(BillingProfileStatus.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileStatusReasonCode.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileStatusReasonCode.java deleted file mode 100644 index 6e83246feb2f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileStatusReasonCode.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BillingProfileStatusReasonCode. */ -public final class BillingProfileStatusReasonCode extends ExpandableStringEnum { - /** Static value PastDue for BillingProfileStatusReasonCode. */ - public static final BillingProfileStatusReasonCode PAST_DUE = fromString("PastDue"); - - /** Static value SpendingLimitReached for BillingProfileStatusReasonCode. */ - public static final BillingProfileStatusReasonCode SPENDING_LIMIT_REACHED = fromString("SpendingLimitReached"); - - /** Static value SpendingLimitExpired for BillingProfileStatusReasonCode. */ - public static final BillingProfileStatusReasonCode SPENDING_LIMIT_EXPIRED = fromString("SpendingLimitExpired"); - - /** - * Creates or finds a BillingProfileStatusReasonCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding BillingProfileStatusReasonCode. - */ - @JsonCreator - public static BillingProfileStatusReasonCode fromString(String name) { - return fromString(name, BillingProfileStatusReasonCode.class); - } - - /** @return known BillingProfileStatusReasonCode values. */ - public static Collection values() { - return values(BillingProfileStatusReasonCode.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfiles.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfiles.java deleted file mode 100644 index 963647c7ca36..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfiles.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; - -/** Resource collection API of BillingProfiles. */ -public interface BillingProfiles { - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the billing profiles that a user has access to. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param expand May be used to expand the invoice sections. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing profiles. - */ - PagedIterable listByBillingAccount(String billingAccountName, String expand, Context context); - - /** - * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile by its ID. - */ - BillingProfile get(String billingAccountName, String billingProfileName); - - /** - * Gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param expand May be used to expand the invoice sections. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile by its ID. - */ - Response getWithResponse( - String billingAccountName, String billingProfileName, String expand, Context context); - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - BillingProfile createOrUpdate(String billingAccountName, String billingProfileName, BillingProfileInner parameters); - - /** - * Creates or updates a billing profile. The operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters The new or updated billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing profile. - */ - BillingProfile createOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesCreateOrUpdateHeaders.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesCreateOrUpdateHeaders.java deleted file mode 100644 index 0e3de662525e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesCreateOrUpdateHeaders.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The BillingProfilesCreateOrUpdateHeaders model. */ -@Fluent -public final class BillingProfilesCreateOrUpdateHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingProfilesCreateOrUpdateHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the BillingProfilesCreateOrUpdateHeaders object itself. - */ - public BillingProfilesCreateOrUpdateHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the BillingProfilesCreateOrUpdateHeaders object itself. - */ - public BillingProfilesCreateOrUpdateHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesCreateOrUpdateResponse.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesCreateOrUpdateResponse.java deleted file mode 100644 index 4e96dc6ce51f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesCreateOrUpdateResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; - -/** Contains all response data for the createOrUpdate operation. */ -public final class BillingProfilesCreateOrUpdateResponse - extends ResponseBase { - /** - * Creates an instance of BillingProfilesCreateOrUpdateResponse. - * - * @param request the request which resulted in this BillingProfilesCreateOrUpdateResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BillingProfilesCreateOrUpdateResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - BillingProfileInner value, - BillingProfilesCreateOrUpdateHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public BillingProfileInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesOnExpand.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesOnExpand.java deleted file mode 100644 index 973e9d0a6a5a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesOnExpand.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * The billing profiles associated with the billing account. By default this is not populated, unless it's specified in - * $expand. - */ -@Fluent -public final class BillingProfilesOnExpand { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingProfilesOnExpand.class); - - /* - * Indicates whether there are more billing profiles than the ones listed - * in this collection. The collection lists a maximum of 50 billing - * profiles. To get all billing profiles, use the list billing profiles - * API. - */ - @JsonProperty(value = "hasMoreResults", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasMoreResults; - - /* - * The billing profiles associated with the billing account. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the hasMoreResults property: Indicates whether there are more billing profiles than the ones listed in this - * collection. The collection lists a maximum of 50 billing profiles. To get all billing profiles, use the list - * billing profiles API. - * - * @return the hasMoreResults value. - */ - public Boolean hasMoreResults() { - return this.hasMoreResults; - } - - /** - * Get the value property: The billing profiles associated with the billing account. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The billing profiles associated with the billing account. - * - * @param value the value value to set. - * @return the BillingProfilesOnExpand object itself. - */ - public BillingProfilesOnExpand withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperties.java deleted file mode 100644 index f14257349f5c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperties.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner; - -/** Resource collection API of BillingProperties. */ -public interface BillingProperties { - /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts with - * agreement type Enterprise Agreement. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the billing properties for a subscription. - */ - BillingProperty get(); - - /** - * Get the billing properties for a subscription. This operation is not supported for billing accounts with - * agreement type Enterprise Agreement. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the billing properties for a subscription. - */ - Response getWithResponse(Context context); - - /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported - * only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param parameters Request parameters that are provided to the update billing property operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing property. - */ - BillingProperty update(BillingPropertyInner parameters); - - /** - * Updates the billing property of a subscription. Currently, cost center can be updated. The operation is supported - * only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param parameters Request parameters that are provided to the update billing property operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing property. - */ - Response updateWithResponse(BillingPropertyInner parameters, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperty.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperty.java deleted file mode 100644 index 14688c694a2e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProperty.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner; - -/** An immutable client-side representation of BillingProperty. */ -public interface BillingProperty { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the accountAdminNotificationEmailAddress property: The email address on which the account admin gets all - * Azure notifications. - * - * @return the accountAdminNotificationEmailAddress value. - */ - String accountAdminNotificationEmailAddress(); - - /** - * Gets the billingTenantId property: The Azure AD tenant ID of the billing account for the subscription. - * - * @return the billingTenantId value. - */ - String billingTenantId(); - - /** - * Gets the billingAccountId property: The ID of the billing account to which the subscription is billed. - * - * @return the billingAccountId value. - */ - String billingAccountId(); - - /** - * Gets the billingAccountDisplayName property: The name of the billing account to which the subscription is billed. - * - * @return the billingAccountDisplayName value. - */ - String billingAccountDisplayName(); - - /** - * Gets the billingProfileId property: The ID of the billing profile to which the subscription is billed. - * - * @return the billingProfileId value. - */ - String billingProfileId(); - - /** - * Gets the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. - * - * @return the billingProfileDisplayName value. - */ - String billingProfileDisplayName(); - - /** - * Gets the billingProfileStatus property: The status of the billing profile. - * - * @return the billingProfileStatus value. - */ - BillingProfileStatus billingProfileStatus(); - - /** - * Gets the billingProfileStatusReasonCode property: Reason for the specified billing profile status. - * - * @return the billingProfileStatusReasonCode value. - */ - BillingProfileStatusReasonCode billingProfileStatusReasonCode(); - - /** - * Gets the billingProfileSpendingLimit property: The billing profile spending limit. - * - * @return the billingProfileSpendingLimit value. - */ - BillingProfileSpendingLimit billingProfileSpendingLimit(); - - /** - * Gets the costCenter property: The cost center applied to the subscription. - * - * @return the costCenter value. - */ - String costCenter(); - - /** - * Gets the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionId value. - */ - String invoiceSectionId(); - - /** - * Gets the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionDisplayName value. - */ - String invoiceSectionDisplayName(); - - /** - * Gets the isAccountAdmin property: Indicates whether user is the account admin. - * - * @return the isAccountAdmin value. - */ - Boolean isAccountAdmin(); - - /** - * Gets the productId property: The product ID of the Azure plan. - * - * @return the productId value. - */ - String productId(); - - /** - * Gets the productName property: The product name of the Azure plan. - * - * @return the productName value. - */ - String productName(); - - /** - * Gets the skuId property: The sku ID of the Azure plan for the subscription. - * - * @return the skuId value. - */ - String skuId(); - - /** - * Gets the skuDescription property: The sku description of the Azure plan for the subscription. - * - * @return the skuDescription value. - */ - String skuDescription(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner object. - * - * @return the inner object. - */ - BillingPropertyInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRelationshipType.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRelationshipType.java deleted file mode 100644 index 17da8c5e2223..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRelationshipType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BillingRelationshipType. */ -public final class BillingRelationshipType extends ExpandableStringEnum { - /** Static value Direct for BillingRelationshipType. */ - public static final BillingRelationshipType DIRECT = fromString("Direct"); - - /** Static value IndirectCustomer for BillingRelationshipType. */ - public static final BillingRelationshipType INDIRECT_CUSTOMER = fromString("IndirectCustomer"); - - /** Static value IndirectPartner for BillingRelationshipType. */ - public static final BillingRelationshipType INDIRECT_PARTNER = fromString("IndirectPartner"); - - /** Static value CSPPartner for BillingRelationshipType. */ - public static final BillingRelationshipType CSPPARTNER = fromString("CSPPartner"); - - /** - * Creates or finds a BillingRelationshipType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BillingRelationshipType. - */ - @JsonCreator - public static BillingRelationshipType fromString(String name) { - return fromString(name, BillingRelationshipType.class); - } - - /** @return known BillingRelationshipType values. */ - public static Collection values() { - return values(BillingRelationshipType.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignment.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignment.java deleted file mode 100644 index 12309dabb5a2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignment.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; - -/** An immutable client-side representation of BillingRoleAssignment. */ -public interface BillingRoleAssignment { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the createdOn property: The date the role assignment was created. - * - * @return the createdOn value. - */ - String createdOn(); - - /** - * Gets the createdByPrincipalTenantId property: The tenant Id of the user who created the role assignment. - * - * @return the createdByPrincipalTenantId value. - */ - String createdByPrincipalTenantId(); - - /** - * Gets the createdByPrincipalId property: The principal Id of the user who created the role assignment. - * - * @return the createdByPrincipalId value. - */ - String createdByPrincipalId(); - - /** - * Gets the createdByUserEmailAddress property: The email address of the user who created the role assignment. - * - * @return the createdByUserEmailAddress value. - */ - String createdByUserEmailAddress(); - - /** - * Gets the principalId property: The principal id of the user to whom the role was assigned. - * - * @return the principalId value. - */ - String principalId(); - - /** - * Gets the principalTenantId property: The principal tenant id of the user to whom the role was assigned. - * - * @return the principalTenantId value. - */ - String principalTenantId(); - - /** - * Gets the roleDefinitionId property: The ID of the role definition. - * - * @return the roleDefinitionId value. - */ - String roleDefinitionId(); - - /** - * Gets the scope property: The scope at which the role was assigned. - * - * @return the scope value. - */ - String scope(); - - /** - * Gets the userAuthenticationType property: The authentication type. - * - * @return the userAuthenticationType value. - */ - String userAuthenticationType(); - - /** - * Gets the userEmailAddress property: The email address of the user. - * - * @return the userEmailAddress value. - */ - String userEmailAddress(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner object. - * - * @return the inner object. - */ - BillingRoleAssignmentInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignmentListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignmentListResult.java deleted file mode 100644 index c6af8ad08b55..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignmentListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of role assignments. */ -@Immutable -public final class BillingRoleAssignmentListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingRoleAssignmentListResult.class); - - /* - * The list of role assignments. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of role assignments. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignments.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignments.java deleted file mode 100644 index db514c419c63..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleAssignments.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of BillingRoleAssignments. */ -public interface BillingRoleAssignments { - /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. - */ - BillingRoleAssignment getByBillingAccount(String billingAccountName, String billingRoleAssignmentName); - - /** - * Gets a role assignment for the caller on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing account. - */ - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context); - - /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - BillingRoleAssignment deleteByBillingAccount(String billingAccountName, String billingRoleAssignmentName); - - /** - * Deletes a role assignment for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - Response deleteByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context); - - /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. - */ - BillingRoleAssignment getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName); - - /** - * Gets a role assignment for the caller on an invoice section. The operation is supported for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on an invoice section. - */ - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context); - - /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - BillingRoleAssignment deleteByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName); - - /** - * Deletes a role assignment for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - Response deleteByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName, - Context context); - - /** - * Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. - */ - BillingRoleAssignment getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName); - - /** - * Gets a role assignment for the caller on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a role assignment for the caller on a billing profile. - */ - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); - - /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - BillingRoleAssignment deleteByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName); - - /** - * Deletes a role assignment for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleAssignmentName The ID that uniquely identifies a role assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the role assignment. - */ - Response deleteByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context); - - /** - * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the role assignments for the caller on a billing account. The operation is supported for billing accounts - * with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - PagedIterable listByBillingAccount(String billingAccountName, Context context); - - /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Lists the role assignments for the caller on an invoice section. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); - - /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the role assignments for the caller on a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role assignments. - */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinition.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinition.java deleted file mode 100644 index c1b7fbb0c17b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinition.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; -import java.util.List; - -/** An immutable client-side representation of BillingRoleDefinition. */ -public interface BillingRoleDefinition { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the description property: The role description. - * - * @return the description value. - */ - String description(); - - /** - * Gets the permissions property: The billingPermissions the role has. - * - * @return the permissions value. - */ - List permissions(); - - /** - * Gets the roleName property: The name of the role. - * - * @return the roleName value. - */ - String roleName(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner object. - * - * @return the inner object. - */ - BillingRoleDefinitionInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitionListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitionListResult.java deleted file mode 100644 index f91d44eddcf3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitionListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of role definitions. */ -@Immutable -public final class BillingRoleDefinitionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingRoleDefinitionListResult.class); - - /* - * The role definitions. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The role definitions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitions.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitions.java deleted file mode 100644 index 9fc865e32bf9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRoleDefinitions.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of BillingRoleDefinitions. */ -public interface BillingRoleDefinitions { - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - BillingRoleDefinition getByBillingAccount(String billingAccountName, String billingRoleDefinitionName); - - /** - * Gets the definition for a role on a billing account. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing account. - */ - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleDefinitionName, Context context); - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. - */ - BillingRoleDefinition getByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName); - - /** - * Gets the definition for a role on an invoice section. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on an invoice section. - */ - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName, - Context context); - - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile. - */ - BillingRoleDefinition getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName); - - /** - * Gets the definition for a role on a billing profile. The operation is supported for billing accounts with - * agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param billingRoleDefinitionName The ID that uniquely identifies a role definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the definition for a role on a billing profile. - */ - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context); - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the role definitions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - PagedIterable listByBillingAccount(String billingAccountName, Context context); - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Lists the role definitions for an invoice section. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the role definitions for a billing profile. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of role definitions. - */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscription.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscription.java deleted file mode 100644 index c2943229bbc6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscription.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import java.util.List; -import java.util.UUID; - -/** An immutable client-side representation of BillingSubscription. */ -public interface BillingSubscription { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the displayName property: The name of the subscription. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the subscriptionId property: The ID of the subscription. - * - * @return the subscriptionId value. - */ - UUID subscriptionId(); - - /** - * Gets the subscriptionBillingStatus property: The current billing status of the subscription. - * - * @return the subscriptionBillingStatus value. - */ - BillingSubscriptionStatusType subscriptionBillingStatus(); - - /** - * Gets the lastMonthCharges property: The last month charges. - * - * @return the lastMonthCharges value. - */ - Amount lastMonthCharges(); - - /** - * Gets the monthToDateCharges property: The current month to date charges. - * - * @return the monthToDateCharges value. - */ - Amount monthToDateCharges(); - - /** - * Gets the billingProfileId property: The ID of the billing profile to which the subscription is billed. - * - * @return the billingProfileId value. - */ - String billingProfileId(); - - /** - * Gets the billingProfileDisplayName property: The name of the billing profile to which the subscription is billed. - * - * @return the billingProfileDisplayName value. - */ - String billingProfileDisplayName(); - - /** - * Gets the costCenter property: The cost center applied to the subscription. - * - * @return the costCenter value. - */ - String costCenter(); - - /** - * Gets the customerId property: The ID of the customer for whom the subscription was created. The field is - * applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerId value. - */ - String customerId(); - - /** - * Gets the customerDisplayName property: The name of the customer for whom the subscription was created. The field - * is applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerDisplayName value. - */ - String customerDisplayName(); - - /** - * Gets the invoiceSectionId property: The ID of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionId value. - */ - String invoiceSectionId(); - - /** - * Gets the invoiceSectionDisplayName property: The name of the invoice section to which the subscription is billed. - * - * @return the invoiceSectionDisplayName value. - */ - String invoiceSectionDisplayName(); - - /** - * Gets the reseller property: Reseller for this subscription. - * - * @return the reseller value. - */ - Reseller reseller(); - - /** - * Gets the skuId property: The sku ID of the Azure plan for the subscription. - * - * @return the skuId value. - */ - String skuId(); - - /** - * Gets the skuDescription property: The sku description of the Azure plan for the subscription. - * - * @return the skuDescription value. - */ - String skuDescription(); - - /** - * Gets the suspensionReasons property: The suspension reason for a subscription. Applies only to subscriptions in - * Microsoft Online Services Program billing accounts. - * - * @return the suspensionReasons value. - */ - List suspensionReasons(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner object. - * - * @return the inner object. - */ - BillingSubscriptionInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionStatusType.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionStatusType.java deleted file mode 100644 index a2ca1265ed9a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionStatusType.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for BillingSubscriptionStatusType. */ -public final class BillingSubscriptionStatusType extends ExpandableStringEnum { - /** Static value Active for BillingSubscriptionStatusType. */ - public static final BillingSubscriptionStatusType ACTIVE = fromString("Active"); - - /** Static value Inactive for BillingSubscriptionStatusType. */ - public static final BillingSubscriptionStatusType INACTIVE = fromString("Inactive"); - - /** Static value Abandoned for BillingSubscriptionStatusType. */ - public static final BillingSubscriptionStatusType ABANDONED = fromString("Abandoned"); - - /** Static value Deleted for BillingSubscriptionStatusType. */ - public static final BillingSubscriptionStatusType DELETED = fromString("Deleted"); - - /** Static value Warning for BillingSubscriptionStatusType. */ - public static final BillingSubscriptionStatusType WARNING = fromString("Warning"); - - /** - * Creates or finds a BillingSubscriptionStatusType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BillingSubscriptionStatusType. - */ - @JsonCreator - public static BillingSubscriptionStatusType fromString(String name) { - return fromString(name, BillingSubscriptionStatusType.class); - } - - /** @return known BillingSubscriptionStatusType values. */ - public static Collection values() { - return values(BillingSubscriptionStatusType.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptions.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptions.java deleted file mode 100644 index 4d9fed6033d1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptions.java +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; - -/** Resource collection API of BillingSubscriptions. */ -public interface BillingSubscriptions { - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - PagedIterable listByCustomer(String billingAccountName, String customerName); - - /** - * Lists the subscriptions for a customer. The operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - PagedIterable listByCustomer(String billingAccountName, String customerName, Context context); - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the subscriptions for a billing account. The operation is supported for billing accounts with agreement - * type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - PagedIterable listByBillingAccount(String billingAccountName, Context context); - - /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the subscriptions that are billed to a billing profile. The operation is supported for billing accounts - * with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); - - /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Lists the subscriptions that are billed to an invoice section. The operation is supported only for billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing subscriptions. - */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); - - /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement and Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a subscription by its ID. - */ - BillingSubscription get(String billingAccountName); - - /** - * Gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft - * Customer Agreement and Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a subscription by its ID. - */ - Response getWithResponse(String billingAccountName, Context context); - - /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - BillingSubscription update(String billingAccountName, BillingSubscriptionInner parameters); - - /** - * Updates the properties of a billing subscription. Currently, cost center can be updated. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the update billing subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, Context context); - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - BillingSubscription move(String billingAccountName, TransferBillingSubscriptionRequestProperties parameters); - - /** - * Moves a subscription's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the move subscription operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a billing subscription. - */ - BillingSubscription move( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context); - - /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the transfer eligibility validation. - */ - ValidateSubscriptionTransferEligibilityResult validateMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters); - - /** - * Validates if a subscription's charges can be moved to a new invoice section. This operation is supported for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the transfer eligibility validation. - */ - Response validateMoveWithResponse( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsListResult.java deleted file mode 100644 index 8da7ec2f2385..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsListResult.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of billing subscriptions. */ -@Immutable -public final class BillingSubscriptionsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingSubscriptionsListResult.class); - - /* - * The list of billing subscriptions. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Total number of records. - */ - @JsonProperty(value = "totalCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer totalCount; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of billing subscriptions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the totalCount property: Total number of records. - * - * @return the totalCount value. - */ - public Integer totalCount() { - return this.totalCount; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsMoveHeaders.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsMoveHeaders.java deleted file mode 100644 index 28d4593ed591..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsMoveHeaders.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The BillingSubscriptionsMoveHeaders model. */ -@Fluent -public final class BillingSubscriptionsMoveHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingSubscriptionsMoveHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the BillingSubscriptionsMoveHeaders object itself. - */ - public BillingSubscriptionsMoveHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the BillingSubscriptionsMoveHeaders object itself. - */ - public BillingSubscriptionsMoveHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsMoveResponse.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsMoveResponse.java deleted file mode 100644 index 1017331eedcc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionsMoveResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; - -/** Contains all response data for the move operation. */ -public final class BillingSubscriptionsMoveResponse - extends ResponseBase { - /** - * Creates an instance of BillingSubscriptionsMoveResponse. - * - * @param request the request which resulted in this BillingSubscriptionsMoveResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public BillingSubscriptionsMoveResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - BillingSubscriptionInner value, - BillingSubscriptionsMoveHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public BillingSubscriptionInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Category.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Category.java deleted file mode 100644 index c82bc4744571..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Category.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Category. */ -public final class Category extends ExpandableStringEnum { - /** Static value MicrosoftCustomerAgreement for Category. */ - public static final Category MICROSOFT_CUSTOMER_AGREEMENT = fromString("MicrosoftCustomerAgreement"); - - /** Static value AffiliatePurchaseTerms for Category. */ - public static final Category AFFILIATE_PURCHASE_TERMS = fromString("AffiliatePurchaseTerms"); - - /** Static value Other for Category. */ - public static final Category OTHER = fromString("Other"); - - /** - * Creates or finds a Category from its string representation. - * - * @param name a name to look for. - * @return the corresponding Category. - */ - @JsonCreator - public static Category fromString(String name) { - return fromString(name, Category.class); - } - - /** @return known Category values. */ - public static Collection values() { - return values(Category.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Customer.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Customer.java deleted file mode 100644 index 5bba073947f6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Customer.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.CustomerInner; -import java.util.List; - -/** An immutable client-side representation of Customer. */ -public interface Customer { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the billingProfileId property: The ID of the billing profile for the invoice section. - * - * @return the billingProfileId value. - */ - String billingProfileId(); - - /** - * Gets the billingProfileDisplayName property: The name of the billing profile for the invoice section. - * - * @return the billingProfileDisplayName value. - */ - String billingProfileDisplayName(); - - /** - * Gets the displayName property: The name of the customer. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the enabledAzurePlans property: Azure plans enabled for the customer. - * - * @return the enabledAzurePlans value. - */ - List enabledAzurePlans(); - - /** - * Gets the resellers property: The list of resellers for which an Azure plan is enabled for the customer. - * - * @return the resellers value. - */ - List resellers(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.CustomerInner object. - * - * @return the inner object. - */ - CustomerInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerListResult.java deleted file mode 100644 index c6b771c4b6d9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerListResult.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.CustomerInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of customers. */ -@Immutable -public final class CustomerListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerListResult.class); - - /* - * The list of customers. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Total number of records. - */ - @JsonProperty(value = "totalCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer totalCount; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of customers. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the totalCount property: Total number of records. - * - * @return the totalCount value. - */ - public Integer totalCount() { - return this.totalCount; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerPolicy.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerPolicy.java deleted file mode 100644 index 378612defd51..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/CustomerPolicy.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; - -/** An immutable client-side representation of CustomerPolicy. */ -public interface CustomerPolicy { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the viewCharges property: The policy that controls whether the users in customer's organization can view - * charges at pay-as-you-go prices. - * - * @return the viewCharges value. - */ - ViewCharges viewCharges(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner object. - * - * @return the inner object. - */ - CustomerPolicyInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Customers.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Customers.java deleted file mode 100644 index dde20eec5f20..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Customers.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Customers. */ -public interface Customers { - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the customers that are billed to a billing profile. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String search, String filter, Context context); - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the customers that are billed to a billing account. The operation is supported only for billing accounts - * with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param search Used for searching customers by their name. Any customer with name containing the search text will - * be included in the response. - * @param filter May be used to filter the list of customers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of customers. - */ - PagedIterable listByBillingAccount( - String billingAccountName, String search, String filter, Context context); - - /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft - * Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a customer by its ID. - */ - Customer get(String billingAccountName, String customerName); - - /** - * Gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft - * Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param expand May be used to expand enabledAzurePlans and resellers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a customer by its ID. - */ - Response getWithResponse(String billingAccountName, String customerName, String expand, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Department.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Department.java deleted file mode 100644 index 3ae2b4a76287..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Department.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.DepartmentProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A department. */ -@Fluent -public final class Department extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Department.class); - - /* - * A department. - */ - @JsonProperty(value = "properties") - private DepartmentProperties innerProperties; - - /** - * Get the innerProperties property: A department. - * - * @return the innerProperties value. - */ - private DepartmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the departmentName property: The name of the department. - * - * @return the departmentName value. - */ - public String departmentName() { - return this.innerProperties() == null ? null : this.innerProperties().departmentName(); - } - - /** - * Set the departmentName property: The name of the department. - * - * @param departmentName the departmentName value to set. - * @return the Department object itself. - */ - public Department withDepartmentName(String departmentName) { - if (this.innerProperties() == null) { - this.innerProperties = new DepartmentProperties(); - } - this.innerProperties().withDepartmentName(departmentName); - return this; - } - - /** - * Get the costCenter property: The cost center associated with the department. - * - * @return the costCenter value. - */ - public String costCenter() { - return this.innerProperties() == null ? null : this.innerProperties().costCenter(); - } - - /** - * Set the costCenter property: The cost center associated with the department. - * - * @param costCenter the costCenter value to set. - * @return the Department object itself. - */ - public Department withCostCenter(String costCenter) { - if (this.innerProperties() == null) { - this.innerProperties = new DepartmentProperties(); - } - this.innerProperties().withCostCenter(costCenter); - return this; - } - - /** - * Get the status property: The status of the department. - * - * @return the status value. - */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The status of the department. - * - * @param status the status value to set. - * @return the Department object itself. - */ - public Department withStatus(String status) { - if (this.innerProperties() == null) { - this.innerProperties = new DepartmentProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the enrollmentAccounts property: Associated enrollment accounts. By default this is not populated, unless - * it's specified in $expand. - * - * @return the enrollmentAccounts value. - */ - public List enrollmentAccounts() { - return this.innerProperties() == null ? null : this.innerProperties().enrollmentAccounts(); - } - - /** - * Set the enrollmentAccounts property: Associated enrollment accounts. By default this is not populated, unless - * it's specified in $expand. - * - * @param enrollmentAccounts the enrollmentAccounts value to set. - * @return the Department object itself. - */ - public Department withEnrollmentAccounts(List enrollmentAccounts) { - if (this.innerProperties() == null) { - this.innerProperties = new DepartmentProperties(); - } - this.innerProperties().withEnrollmentAccounts(enrollmentAccounts); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Document.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Document.java deleted file mode 100644 index b220edb350a9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Document.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a document. */ -@Immutable -public final class Document { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Document.class); - - /* - * The type of the document. - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private DocumentType kind; - - /* - * Document URL. - */ - @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) - private String url; - - /* - * The source of the document. ENF for Brazil and DRS for rest of the - * world. - */ - @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY) - private DocumentSource source; - - /** - * Get the kind property: The type of the document. - * - * @return the kind value. - */ - public DocumentType kind() { - return this.kind; - } - - /** - * Get the url property: Document URL. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Get the source property: The source of the document. ENF for Brazil and DRS for rest of the world. - * - * @return the source value. - */ - public DocumentSource source() { - return this.source; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DocumentSource.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DocumentSource.java deleted file mode 100644 index 05c5bde83de4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DocumentSource.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DocumentSource. */ -public final class DocumentSource extends ExpandableStringEnum { - /** Static value DRS for DocumentSource. */ - public static final DocumentSource DRS = fromString("DRS"); - - /** Static value ENF for DocumentSource. */ - public static final DocumentSource ENF = fromString("ENF"); - - /** - * Creates or finds a DocumentSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding DocumentSource. - */ - @JsonCreator - public static DocumentSource fromString(String name) { - return fromString(name, DocumentSource.class); - } - - /** @return known DocumentSource values. */ - public static Collection values() { - return values(DocumentSource.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DocumentType.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DocumentType.java deleted file mode 100644 index f838d2ce83e7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DocumentType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DocumentType. */ -public final class DocumentType extends ExpandableStringEnum { - /** Static value Invoice for DocumentType. */ - public static final DocumentType INVOICE = fromString("Invoice"); - - /** Static value VoidNote for DocumentType. */ - public static final DocumentType VOID_NOTE = fromString("VoidNote"); - - /** Static value TaxReceipt for DocumentType. */ - public static final DocumentType TAX_RECEIPT = fromString("TaxReceipt"); - - /** Static value CreditNote for DocumentType. */ - public static final DocumentType CREDIT_NOTE = fromString("CreditNote"); - - /** - * Creates or finds a DocumentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding DocumentType. - */ - @JsonCreator - public static DocumentType fromString(String name) { - return fromString(name, DocumentType.class); - } - - /** @return known DocumentType values. */ - public static Collection values() { - return values(DocumentType.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DownloadUrl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DownloadUrl.java deleted file mode 100644 index fc484bae3420..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DownloadUrl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of DownloadUrl. */ -public interface DownloadUrl { - /** - * Gets the expiryTime property: The time in UTC when the download URL will expire. - * - * @return the expiryTime value. - */ - OffsetDateTime expiryTime(); - - /** - * Gets the url property: The URL to the PDF file. - * - * @return the url value. - */ - String url(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner object. - * - * @return the inner object. - */ - DownloadUrlInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Enrollment.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Enrollment.java deleted file mode 100644 index 853e8ab502ad..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Enrollment.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of an enrollment. */ -@Fluent -public final class Enrollment { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Enrollment.class); - - /* - * The start date of the enrollment. - */ - @JsonProperty(value = "startDate") - private OffsetDateTime startDate; - - /* - * The end date of the enrollment. - */ - @JsonProperty(value = "endDate") - private OffsetDateTime endDate; - - /* - * The billing currency for the enrollment. - */ - @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; - - /* - * The channel type of the enrollment. - */ - @JsonProperty(value = "channel", access = JsonProperty.Access.WRITE_ONLY) - private String channel; - - /* - * The policies for Enterprise Agreement enrollments. - */ - @JsonProperty(value = "policies", access = JsonProperty.Access.WRITE_ONLY) - private EnrollmentPolicies policies; - - /* - * The language for the enrollment. - */ - @JsonProperty(value = "language", access = JsonProperty.Access.WRITE_ONLY) - private String language; - - /* - * The country code of the enrollment. - */ - @JsonProperty(value = "countryCode", access = JsonProperty.Access.WRITE_ONLY) - private String countryCode; - - /* - * The current status of the enrollment. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * The billing cycle for the enrollment. - */ - @JsonProperty(value = "billingCycle", access = JsonProperty.Access.WRITE_ONLY) - private String billingCycle; - - /** - * Get the startDate property: The start date of the enrollment. - * - * @return the startDate value. - */ - public OffsetDateTime startDate() { - return this.startDate; - } - - /** - * Set the startDate property: The start date of the enrollment. - * - * @param startDate the startDate value to set. - * @return the Enrollment object itself. - */ - public Enrollment withStartDate(OffsetDateTime startDate) { - this.startDate = startDate; - return this; - } - - /** - * Get the endDate property: The end date of the enrollment. - * - * @return the endDate value. - */ - public OffsetDateTime endDate() { - return this.endDate; - } - - /** - * Set the endDate property: The end date of the enrollment. - * - * @param endDate the endDate value to set. - * @return the Enrollment object itself. - */ - public Enrollment withEndDate(OffsetDateTime endDate) { - this.endDate = endDate; - return this; - } - - /** - * Get the currency property: The billing currency for the enrollment. - * - * @return the currency value. - */ - public String currency() { - return this.currency; - } - - /** - * Get the channel property: The channel type of the enrollment. - * - * @return the channel value. - */ - public String channel() { - return this.channel; - } - - /** - * Get the policies property: The policies for Enterprise Agreement enrollments. - * - * @return the policies value. - */ - public EnrollmentPolicies policies() { - return this.policies; - } - - /** - * Get the language property: The language for the enrollment. - * - * @return the language value. - */ - public String language() { - return this.language; - } - - /** - * Get the countryCode property: The country code of the enrollment. - * - * @return the countryCode value. - */ - public String countryCode() { - return this.countryCode; - } - - /** - * Get the status property: The current status of the enrollment. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the billingCycle property: The billing cycle for the enrollment. - * - * @return the billingCycle value. - */ - public String billingCycle() { - return this.billingCycle; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (policies() != null) { - policies().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccount.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccount.java deleted file mode 100644 index d0d7e9372ed0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccount.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** An enrollment account. */ -@Fluent -public final class EnrollmentAccount extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrollmentAccount.class); - - /* - * The properties of an enrollment account. - */ - @JsonProperty(value = "properties") - private EnrollmentAccountProperties innerProperties; - - /** - * Get the innerProperties property: The properties of an enrollment account. - * - * @return the innerProperties value. - */ - private EnrollmentAccountProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the accountName property: The name of the enrollment account. - * - * @return the accountName value. - */ - public String accountName() { - return this.innerProperties() == null ? null : this.innerProperties().accountName(); - } - - /** - * Set the accountName property: The name of the enrollment account. - * - * @param accountName the accountName value to set. - * @return the EnrollmentAccount object itself. - */ - public EnrollmentAccount withAccountName(String accountName) { - if (this.innerProperties() == null) { - this.innerProperties = new EnrollmentAccountProperties(); - } - this.innerProperties().withAccountName(accountName); - return this; - } - - /** - * Get the costCenter property: The cost center associated with the enrollment account. - * - * @return the costCenter value. - */ - public String costCenter() { - return this.innerProperties() == null ? null : this.innerProperties().costCenter(); - } - - /** - * Set the costCenter property: The cost center associated with the enrollment account. - * - * @param costCenter the costCenter value to set. - * @return the EnrollmentAccount object itself. - */ - public EnrollmentAccount withCostCenter(String costCenter) { - if (this.innerProperties() == null) { - this.innerProperties = new EnrollmentAccountProperties(); - } - this.innerProperties().withCostCenter(costCenter); - return this; - } - - /** - * Get the accountOwner property: The owner of the enrollment account. - * - * @return the accountOwner value. - */ - public String accountOwner() { - return this.innerProperties() == null ? null : this.innerProperties().accountOwner(); - } - - /** - * Set the accountOwner property: The owner of the enrollment account. - * - * @param accountOwner the accountOwner value to set. - * @return the EnrollmentAccount object itself. - */ - public EnrollmentAccount withAccountOwner(String accountOwner) { - if (this.innerProperties() == null) { - this.innerProperties = new EnrollmentAccountProperties(); - } - this.innerProperties().withAccountOwner(accountOwner); - return this; - } - - /** - * Get the accountOwnerEmail property: The enrollment account owner email address. - * - * @return the accountOwnerEmail value. - */ - public String accountOwnerEmail() { - return this.innerProperties() == null ? null : this.innerProperties().accountOwnerEmail(); - } - - /** - * Set the accountOwnerEmail property: The enrollment account owner email address. - * - * @param accountOwnerEmail the accountOwnerEmail value to set. - * @return the EnrollmentAccount object itself. - */ - public EnrollmentAccount withAccountOwnerEmail(String accountOwnerEmail) { - if (this.innerProperties() == null) { - this.innerProperties = new EnrollmentAccountProperties(); - } - this.innerProperties().withAccountOwnerEmail(accountOwnerEmail); - return this; - } - - /** - * Get the status property: The status of the enrollment account. - * - * @return the status value. - */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The status of the enrollment account. - * - * @param status the status value to set. - * @return the EnrollmentAccount object itself. - */ - public EnrollmentAccount withStatus(String status) { - if (this.innerProperties() == null) { - this.innerProperties = new EnrollmentAccountProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the startDate property: The start date of the enrollment account. - * - * @return the startDate value. - */ - public OffsetDateTime startDate() { - return this.innerProperties() == null ? null : this.innerProperties().startDate(); - } - - /** - * Set the startDate property: The start date of the enrollment account. - * - * @param startDate the startDate value to set. - * @return the EnrollmentAccount object itself. - */ - public EnrollmentAccount withStartDate(OffsetDateTime startDate) { - if (this.innerProperties() == null) { - this.innerProperties = new EnrollmentAccountProperties(); - } - this.innerProperties().withStartDate(startDate); - return this; - } - - /** - * Get the endDate property: The end date of the enrollment account. - * - * @return the endDate value. - */ - public OffsetDateTime endDate() { - return this.innerProperties() == null ? null : this.innerProperties().endDate(); - } - - /** - * Set the endDate property: The end date of the enrollment account. - * - * @param endDate the endDate value to set. - * @return the EnrollmentAccount object itself. - */ - public EnrollmentAccount withEndDate(OffsetDateTime endDate) { - if (this.innerProperties() == null) { - this.innerProperties = new EnrollmentAccountProperties(); - } - this.innerProperties().withEndDate(endDate); - return this; - } - - /** - * Get the department property: Associated department. By default this is not populated, unless it's specified in - * $expand. - * - * @return the department value. - */ - public Department department() { - return this.innerProperties() == null ? null : this.innerProperties().department(); - } - - /** - * Set the department property: Associated department. By default this is not populated, unless it's specified in - * $expand. - * - * @param department the department value to set. - * @return the EnrollmentAccount object itself. - */ - public EnrollmentAccount withDepartment(Department department) { - if (this.innerProperties() == null) { - this.innerProperties = new EnrollmentAccountProperties(); - } - this.innerProperties().withDepartment(department); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountListResult.java deleted file mode 100644 index 76252ce9848a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of listing enrollment accounts. */ -@Immutable -public final class EnrollmentAccountListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrollmentAccountListResult.class); - - /* - * The list of enrollment accounts. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of enrollment accounts. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountSummary.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountSummary.java deleted file mode 100644 index d3b01bf1360e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccountSummary.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; - -/** An immutable client-side representation of EnrollmentAccountSummary. */ -public interface EnrollmentAccountSummary { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the principalName property: The account owner's principal name. - * - * @return the principalName value. - */ - String principalName(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner object. - * - * @return the inner object. - */ - EnrollmentAccountSummaryInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccounts.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccounts.java deleted file mode 100644 index 243221dcb517..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentAccounts.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of EnrollmentAccounts. */ -public interface EnrollmentAccounts { - /** - * Lists the enrollment accounts the caller has access to. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - PagedIterable list(); - - /** - * Lists the enrollment accounts the caller has access to. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing enrollment accounts. - */ - PagedIterable list(Context context); - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - EnrollmentAccountSummary get(String name); - - /** - * Gets a enrollment account by name. - * - * @param name Enrollment Account name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a enrollment account by name. - */ - Response getWithResponse(String name, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentPolicies.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentPolicies.java deleted file mode 100644 index 4a8a324445e5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentPolicies.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The policies for Enterprise Agreement enrollments. */ -@Immutable -public final class EnrollmentPolicies { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnrollmentPolicies.class); - - /* - * The policy that controls whether Account Owners can view charges. - */ - @JsonProperty(value = "accountOwnerViewCharges", access = JsonProperty.Access.WRITE_ONLY) - private Boolean accountOwnerViewCharges; - - /* - * The policy that controls whether Department Administrators can view - * charges. - */ - @JsonProperty(value = "departmentAdminViewCharges", access = JsonProperty.Access.WRITE_ONLY) - private Boolean departmentAdminViewCharges; - - /* - * The policy that controls whether Azure marketplace purchases are allowed - * in the enrollment. - */ - @JsonProperty(value = "marketplaceEnabled", access = JsonProperty.Access.WRITE_ONLY) - private Boolean marketplaceEnabled; - - /* - * The policy that controls whether Azure reservation purchases are allowed - * in the enrollment. - */ - @JsonProperty(value = "reservedInstancesEnabled", access = JsonProperty.Access.WRITE_ONLY) - private Boolean reservedInstancesEnabled; - - /** - * Get the accountOwnerViewCharges property: The policy that controls whether Account Owners can view charges. - * - * @return the accountOwnerViewCharges value. - */ - public Boolean accountOwnerViewCharges() { - return this.accountOwnerViewCharges; - } - - /** - * Get the departmentAdminViewCharges property: The policy that controls whether Department Administrators can view - * charges. - * - * @return the departmentAdminViewCharges value. - */ - public Boolean departmentAdminViewCharges() { - return this.departmentAdminViewCharges; - } - - /** - * Get the marketplaceEnabled property: The policy that controls whether Azure marketplace purchases are allowed in - * the enrollment. - * - * @return the marketplaceEnabled value. - */ - public Boolean marketplaceEnabled() { - return this.marketplaceEnabled; - } - - /** - * Get the reservedInstancesEnabled property: The policy that controls whether Azure reservation purchases are - * allowed in the enrollment. - * - * @return the reservedInstancesEnabled value. - */ - public Boolean reservedInstancesEnabled() { - return this.reservedInstancesEnabled; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/IndirectRelationshipInfo.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/IndirectRelationshipInfo.java deleted file mode 100644 index 7a7349698cb1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/IndirectRelationshipInfo.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The billing profile details of the partner of the customer for an indirect motion. */ -@Fluent -public final class IndirectRelationshipInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IndirectRelationshipInfo.class); - - /* - * The billing account name of the partner or the customer for an indirect - * motion. - */ - @JsonProperty(value = "billingAccountName") - private String billingAccountName; - - /* - * The billing profile name of the partner or the customer for an indirect - * motion. - */ - @JsonProperty(value = "billingProfileName") - private String billingProfileName; - - /* - * The display name of the partner or customer for an indirect motion. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /** - * Get the billingAccountName property: The billing account name of the partner or the customer for an indirect - * motion. - * - * @return the billingAccountName value. - */ - public String billingAccountName() { - return this.billingAccountName; - } - - /** - * Set the billingAccountName property: The billing account name of the partner or the customer for an indirect - * motion. - * - * @param billingAccountName the billingAccountName value to set. - * @return the IndirectRelationshipInfo object itself. - */ - public IndirectRelationshipInfo withBillingAccountName(String billingAccountName) { - this.billingAccountName = billingAccountName; - return this; - } - - /** - * Get the billingProfileName property: The billing profile name of the partner or the customer for an indirect - * motion. - * - * @return the billingProfileName value. - */ - public String billingProfileName() { - return this.billingProfileName; - } - - /** - * Set the billingProfileName property: The billing profile name of the partner or the customer for an indirect - * motion. - * - * @param billingProfileName the billingProfileName value to set. - * @return the IndirectRelationshipInfo object itself. - */ - public IndirectRelationshipInfo withBillingProfileName(String billingProfileName) { - this.billingProfileName = billingProfileName; - return this; - } - - /** - * Get the displayName property: The display name of the partner or customer for an indirect motion. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the partner or customer for an indirect motion. - * - * @param displayName the displayName value to set. - * @return the IndirectRelationshipInfo object itself. - */ - public IndirectRelationshipInfo withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instruction.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instruction.java deleted file mode 100644 index 0ae66007b7b1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instruction.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of Instruction. */ -public interface Instruction { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the amount property: The amount budgeted for this billing instruction. - * - * @return the amount value. - */ - float amount(); - - /** - * Gets the startDate property: The date this billing instruction goes into effect. - * - * @return the startDate value. - */ - OffsetDateTime startDate(); - - /** - * Gets the endDate property: The date this billing instruction is no longer in effect. - * - * @return the endDate value. - */ - OffsetDateTime endDate(); - - /** - * Gets the creationDate property: The date this billing instruction was created. - * - * @return the creationDate value. - */ - OffsetDateTime creationDate(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.InstructionInner object. - * - * @return the inner object. - */ - InstructionInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InstructionListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InstructionListResult.java deleted file mode 100644 index ffa38b2217d0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InstructionListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of billing instructions used during invoice generation. */ -@Immutable -public final class InstructionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InstructionListResult.class); - - /* - * The list of billing instructions used during invoice generation. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of billing instructions used during invoice generation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instructions.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instructions.java deleted file mode 100644 index c103d55aac7b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instructions.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; - -/** Resource collection API of Instructions. */ -public interface Instructions { - /** - * Lists the instructions by billing profile id. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the instructions by billing profile id. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing instructions used during invoice generation. - */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); - - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instruction by name. - */ - Instruction get(String billingAccountName, String billingProfileName, String instructionName); - - /** - * Get the instruction by name. These are custom billing instructions and are only applicable for certain customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instruction by name. - */ - Response getWithResponse( - String billingAccountName, String billingProfileName, String instructionName, Context context); - - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for certain - * customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instruction. - */ - Instruction put( - String billingAccountName, String billingProfileName, String instructionName, InstructionInner parameters); - - /** - * Creates or updates an instruction. These are custom billing instructions and are only applicable for certain - * customers. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param instructionName Instruction Name. - * @param parameters The new instruction. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an instruction. - */ - Response putWithResponse( - String billingAccountName, - String billingProfileName, - String instructionName, - InstructionInner parameters, - Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoice.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoice.java deleted file mode 100644 index 2a6232c36666..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoice.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of Invoice. */ -public interface Invoice { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the dueDate property: The due date for the invoice. - * - * @return the dueDate value. - */ - OffsetDateTime dueDate(); - - /** - * Gets the invoiceDate property: The date when the invoice was generated. - * - * @return the invoiceDate value. - */ - OffsetDateTime invoiceDate(); - - /** - * Gets the status property: The current status of the invoice. - * - * @return the status value. - */ - InvoiceStatus status(); - - /** - * Gets the amountDue property: The amount due as of now. - * - * @return the amountDue value. - */ - Amount amountDue(); - - /** - * Gets the azurePrepaymentApplied property: The amount of Azure prepayment applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the azurePrepaymentApplied value. - */ - Amount azurePrepaymentApplied(); - - /** - * Gets the billedAmount property: The total charges for the invoice billing period. - * - * @return the billedAmount value. - */ - Amount billedAmount(); - - /** - * Gets the creditAmount property: The total refund for returns and cancellations during the invoice billing period. - * This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the creditAmount value. - */ - Amount creditAmount(); - - /** - * Gets the freeAzureCreditApplied property: The amount of free Azure credits applied to the charges. This field is - * applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the freeAzureCreditApplied value. - */ - Amount freeAzureCreditApplied(); - - /** - * Gets the subTotal property: The pre-tax amount due. This field is applicable to billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @return the subTotal value. - */ - Amount subTotal(); - - /** - * Gets the taxAmount property: The amount of tax charged for the billing period. This field is applicable to - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the taxAmount value. - */ - Amount taxAmount(); - - /** - * Gets the totalAmount property: The amount due when the invoice was generated. This field is applicable to billing - * accounts with agreement type Microsoft Customer Agreement. - * - * @return the totalAmount value. - */ - Amount totalAmount(); - - /** - * Gets the invoicePeriodStartDate property: The start date of the billing period for which the invoice is - * generated. - * - * @return the invoicePeriodStartDate value. - */ - OffsetDateTime invoicePeriodStartDate(); - - /** - * Gets the invoicePeriodEndDate property: The end date of the billing period for which the invoice is generated. - * - * @return the invoicePeriodEndDate value. - */ - OffsetDateTime invoicePeriodEndDate(); - - /** - * Gets the invoiceType property: Invoice type. - * - * @return the invoiceType value. - */ - InvoiceType invoiceType(); - - /** - * Gets the isMonthlyInvoice property: Specifies if the invoice is generated as part of monthly invoicing cycle or - * not. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. - * - * @return the isMonthlyInvoice value. - */ - Boolean isMonthlyInvoice(); - - /** - * Gets the billingProfileId property: The ID of the billing profile for which the invoice is generated. - * - * @return the billingProfileId value. - */ - String billingProfileId(); - - /** - * Gets the billingProfileDisplayName property: The name of the billing profile for which the invoice is generated. - * - * @return the billingProfileDisplayName value. - */ - String billingProfileDisplayName(); - - /** - * Gets the purchaseOrderNumber property: An optional purchase order number for the invoice. - * - * @return the purchaseOrderNumber value. - */ - String purchaseOrderNumber(); - - /** - * Gets the documents property: List of documents available to download such as invoice and tax receipt. - * - * @return the documents value. - */ - List documents(); - - /** - * Gets the payments property: List of payments. - * - * @return the payments value. - */ - List payments(); - - /** - * Gets the rebillDetails property: Rebill details for an invoice. - * - * @return the rebillDetails value. - */ - Map rebillDetails(); - - /** - * Gets the documentType property: The type of the document. - * - * @return the documentType value. - */ - InvoiceDocumentType documentType(); - - /** - * Gets the billedDocumentId property: The Id of the active invoice which is originally billed after this invoice - * was voided. This field is applicable to the void invoices only. - * - * @return the billedDocumentId value. - */ - String billedDocumentId(); - - /** - * Gets the creditForDocumentId property: The Id of the invoice which got voided and this credit note was issued as - * a result. This field is applicable to the credit notes only. - * - * @return the creditForDocumentId value. - */ - String creditForDocumentId(); - - /** - * Gets the subscriptionId property: The ID of the subscription for which the invoice is generated. - * - * @return the subscriptionId value. - */ - String subscriptionId(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.InvoiceInner object. - * - * @return the inner object. - */ - InvoiceInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceDocumentType.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceDocumentType.java deleted file mode 100644 index 9f0fec604b55..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceDocumentType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for InvoiceDocumentType. */ -public final class InvoiceDocumentType extends ExpandableStringEnum { - /** Static value Invoice for InvoiceDocumentType. */ - public static final InvoiceDocumentType INVOICE = fromString("Invoice"); - - /** Static value CreditNote for InvoiceDocumentType. */ - public static final InvoiceDocumentType CREDIT_NOTE = fromString("CreditNote"); - - /** - * Creates or finds a InvoiceDocumentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding InvoiceDocumentType. - */ - @JsonCreator - public static InvoiceDocumentType fromString(String name) { - return fromString(name, InvoiceDocumentType.class); - } - - /** @return known InvoiceDocumentType values. */ - public static Collection values() { - return values(InvoiceDocumentType.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java deleted file mode 100644 index d4b590e7e985..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of invoices. */ -@Immutable -public final class InvoiceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoiceListResult.class); - - /* - * The list of invoices. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of invoices. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSection.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSection.java deleted file mode 100644 index 9c438923d556..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSection.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import java.util.Map; - -/** An immutable client-side representation of InvoiceSection. */ -public interface InvoiceSection { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the displayName property: The name of the invoice section. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the labels property: Dictionary of metadata associated with the invoice section. - * - * @return the labels value. - */ - Map labels(); - - /** - * Gets the state property: Identifies the state of an invoice section. - * - * @return the state value. - */ - InvoiceSectionState state(); - - /** - * Gets the systemId property: The system generated unique identifier for an invoice section. - * - * @return the systemId value. - */ - String systemId(); - - /** - * Gets the tags property: Dictionary of metadata associated with the invoice section. Maximum key/value length - * supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ - * ? /. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the targetCloud property: Identifies the cloud environments that are associated with an invoice section. - * This is a system managed optional field and gets updated as the invoice section gets associated with accounts in - * various clouds. - * - * @return the targetCloud value. - */ - TargetCloud targetCloud(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner object. - * - * @return the inner object. - */ - InvoiceSectionInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListResult.java deleted file mode 100644 index d39eaef775ff..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListResult.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of invoice sections. */ -@Immutable -public final class InvoiceSectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoiceSectionListResult.class); - - /* - * The list of invoice sections. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Total number of records. - */ - @JsonProperty(value = "totalCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer totalCount; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of invoice sections. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the totalCount property: Total number of records. - * - * @return the totalCount value. - */ - public Integer totalCount() { - return this.totalCount; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListWithCreateSubPermissionResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListWithCreateSubPermissionResult.java deleted file mode 100644 index b08686544b67..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListWithCreateSubPermissionResult.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionWithCreateSubPermissionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of invoice section properties with create subscription permission. */ -@Fluent -public final class InvoiceSectionListWithCreateSubPermissionResult { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(InvoiceSectionListWithCreateSubPermissionResult.class); - - /* - * The list of invoice section properties with create subscription - * permission. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of invoice section properties with create subscription permission. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of invoice section properties with create subscription permission. - * - * @param value the value value to set. - * @return the InvoiceSectionListWithCreateSubPermissionResult object itself. - */ - public InvoiceSectionListWithCreateSubPermissionResult withValue( - List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionState.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionState.java deleted file mode 100644 index cf4620ae2294..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionState.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for InvoiceSectionState. */ -public final class InvoiceSectionState extends ExpandableStringEnum { - /** Static value Active for InvoiceSectionState. */ - public static final InvoiceSectionState ACTIVE = fromString("Active"); - - /** Static value Restricted for InvoiceSectionState. */ - public static final InvoiceSectionState RESTRICTED = fromString("Restricted"); - - /** - * Creates or finds a InvoiceSectionState from its string representation. - * - * @param name a name to look for. - * @return the corresponding InvoiceSectionState. - */ - @JsonCreator - public static InvoiceSectionState fromString(String name) { - return fromString(name, InvoiceSectionState.class); - } - - /** @return known InvoiceSectionState values. */ - public static Collection values() { - return values(InvoiceSectionState.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionWithCreateSubPermission.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionWithCreateSubPermission.java deleted file mode 100644 index 0ec3115c1bcc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionWithCreateSubPermission.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionWithCreateSubPermissionInner; -import java.util.List; - -/** An immutable client-side representation of InvoiceSectionWithCreateSubPermission. */ -public interface InvoiceSectionWithCreateSubPermission { - /** - * Gets the invoiceSectionId property: The ID of the invoice section. - * - * @return the invoiceSectionId value. - */ - String invoiceSectionId(); - - /** - * Gets the invoiceSectionDisplayName property: The name of the invoice section. - * - * @return the invoiceSectionDisplayName value. - */ - String invoiceSectionDisplayName(); - - /** - * Gets the invoiceSectionSystemId property: The system generated unique identifier for an invoice section. - * - * @return the invoiceSectionSystemId value. - */ - String invoiceSectionSystemId(); - - /** - * Gets the billingProfileId property: The ID of the billing profile for the invoice section. - * - * @return the billingProfileId value. - */ - String billingProfileId(); - - /** - * Gets the billingProfileDisplayName property: The name of the billing profile for the invoice section. - * - * @return the billingProfileDisplayName value. - */ - String billingProfileDisplayName(); - - /** - * Gets the billingProfileStatus property: The status of the billing profile. - * - * @return the billingProfileStatus value. - */ - BillingProfileStatus billingProfileStatus(); - - /** - * Gets the billingProfileStatusReasonCode property: Reason for the specified billing profile status. - * - * @return the billingProfileStatusReasonCode value. - */ - StatusReasonCodeForBillingProfile billingProfileStatusReasonCode(); - - /** - * Gets the billingProfileSpendingLimit property: The billing profile spending limit. - * - * @return the billingProfileSpendingLimit value. - */ - SpendingLimitForBillingProfile billingProfileSpendingLimit(); - - /** - * Gets the billingProfileSystemId property: The system generated unique identifier for a billing profile. - * - * @return the billingProfileSystemId value. - */ - String billingProfileSystemId(); - - /** - * Gets the enabledAzurePlans property: Enabled azure plans for the associated billing profile. - * - * @return the enabledAzurePlans value. - */ - List enabledAzurePlans(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.InvoiceSectionWithCreateSubPermissionInner object. - * - * @return the inner object. - */ - InvoiceSectionWithCreateSubPermissionInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSections.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSections.java deleted file mode 100644 index b76e9dad4aed..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSections.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; - -/** Resource collection API of InvoiceSections. */ -public interface InvoiceSections { - /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the invoice sections that a user has access to. The operation is supported only for billing accounts with - * agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoice sections. - */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, Context context); - - /** - * Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section by its ID. - */ - InvoiceSection get(String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section by its ID. - */ - Response getWithResponse( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context); - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - InvoiceSection createOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters); - - /** - * Creates or updates an invoice section. The operation is supported only for billing accounts with agreement type - * Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param parameters The new or updated invoice section. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice section. - */ - InvoiceSection createOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters, - Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsCreateOrUpdateHeaders.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsCreateOrUpdateHeaders.java deleted file mode 100644 index 393d88051aca..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsCreateOrUpdateHeaders.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The InvoiceSectionsCreateOrUpdateHeaders model. */ -@Fluent -public final class InvoiceSectionsCreateOrUpdateHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoiceSectionsCreateOrUpdateHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the InvoiceSectionsCreateOrUpdateHeaders object itself. - */ - public InvoiceSectionsCreateOrUpdateHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the InvoiceSectionsCreateOrUpdateHeaders object itself. - */ - public InvoiceSectionsCreateOrUpdateHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsCreateOrUpdateResponse.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsCreateOrUpdateResponse.java deleted file mode 100644 index d340d6d03eda..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsCreateOrUpdateResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; - -/** Contains all response data for the createOrUpdate operation. */ -public final class InvoiceSectionsCreateOrUpdateResponse - extends ResponseBase { - /** - * Creates an instance of InvoiceSectionsCreateOrUpdateResponse. - * - * @param request the request which resulted in this InvoiceSectionsCreateOrUpdateResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public InvoiceSectionsCreateOrUpdateResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - InvoiceSectionInner value, - InvoiceSectionsCreateOrUpdateHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public InvoiceSectionInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsOnExpand.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsOnExpand.java deleted file mode 100644 index fe8e65e1c165..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsOnExpand.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in - * $expand. - */ -@Fluent -public final class InvoiceSectionsOnExpand { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoiceSectionsOnExpand.class); - - /* - * Indicates whether there are more invoice sections than the ones listed - * in this collection. The collection lists a maximum of 50 invoice - * sections. To get all invoice sections, use the list invoice sections - * API. - */ - @JsonProperty(value = "hasMoreResults", access = JsonProperty.Access.WRITE_ONLY) - private Boolean hasMoreResults; - - /* - * The invoice sections associated to the billing profile. - */ - @JsonProperty(value = "value") - private List value; - - /** - * Get the hasMoreResults property: Indicates whether there are more invoice sections than the ones listed in this - * collection. The collection lists a maximum of 50 invoice sections. To get all invoice sections, use the list - * invoice sections API. - * - * @return the hasMoreResults value. - */ - public Boolean hasMoreResults() { - return this.hasMoreResults; - } - - /** - * Get the value property: The invoice sections associated to the billing profile. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The invoice sections associated to the billing profile. - * - * @param value the value value to set. - * @return the InvoiceSectionsOnExpand object itself. - */ - public InvoiceSectionsOnExpand withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceStatus.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceStatus.java deleted file mode 100644 index 0bed6fdc4749..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceStatus.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for InvoiceStatus. */ -public final class InvoiceStatus extends ExpandableStringEnum { - /** Static value Due for InvoiceStatus. */ - public static final InvoiceStatus DUE = fromString("Due"); - - /** Static value OverDue for InvoiceStatus. */ - public static final InvoiceStatus OVER_DUE = fromString("OverDue"); - - /** Static value Paid for InvoiceStatus. */ - public static final InvoiceStatus PAID = fromString("Paid"); - - /** Static value Void for InvoiceStatus. */ - public static final InvoiceStatus VOID = fromString("Void"); - - /** - * Creates or finds a InvoiceStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding InvoiceStatus. - */ - @JsonCreator - public static InvoiceStatus fromString(String name) { - return fromString(name, InvoiceStatus.class); - } - - /** @return known InvoiceStatus values. */ - public static Collection values() { - return values(InvoiceStatus.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceType.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceType.java deleted file mode 100644 index b548529d1392..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for InvoiceType. */ -public final class InvoiceType extends ExpandableStringEnum { - /** Static value AzureService for InvoiceType. */ - public static final InvoiceType AZURE_SERVICE = fromString("AzureService"); - - /** Static value AzureMarketplace for InvoiceType. */ - public static final InvoiceType AZURE_MARKETPLACE = fromString("AzureMarketplace"); - - /** Static value AzureSupport for InvoiceType. */ - public static final InvoiceType AZURE_SUPPORT = fromString("AzureSupport"); - - /** - * Creates or finds a InvoiceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding InvoiceType. - */ - @JsonCreator - public static InvoiceType fromString(String name) { - return fromString(name, InvoiceType.class); - } - - /** @return known InvoiceType values. */ - public static Collection values() { - return values(InvoiceType.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoices.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoices.java deleted file mode 100644 index a505ffbd0fba..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Invoices.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import java.util.List; - -/** Resource collection API of Invoices. */ -public interface Invoices { - /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate); - - /** - * Lists the invoices for a billing account for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - PagedIterable listByBillingAccount( - String billingAccountName, String periodStartDate, String periodEndDate, Context context); - - /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String periodStartDate, String periodEndDate); - - /** - * Lists the invoices for a billing profile for a given start date and end date. The operation is supported for - * billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param periodStartDate The start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param periodEndDate The end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String periodStartDate, - String periodEndDate, - Context context); - - /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by billing account name and ID. - */ - Invoice get(String billingAccountName, String invoiceName); - - /** - * Gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement - * type Microsoft Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by billing account name and ID. - */ - Response getWithResponse(String billingAccountName, String invoiceName, Context context); - - /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - Invoice getById(String invoiceName); - - /** - * Gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner - * Agreement or Microsoft Customer Agreement. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by ID. - */ - Response getByIdWithResponse(String invoiceName, Context context); - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - DownloadUrl downloadInvoice(String billingAccountName, String invoiceName, String downloadToken); - - /** - * Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft - * Partner Agreement or Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - DownloadUrl downloadInvoice(String billingAccountName, String invoiceName, String downloadToken, Context context); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - DownloadUrl downloadMultipleBillingProfileInvoices(String billingAccountName, List downloadUrls); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The - * operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - DownloadUrl downloadMultipleBillingProfileInvoices( - String billingAccountName, List downloadUrls, Context context); - - /** - * Lists the invoices for a subscription. - * - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - PagedIterable listByBillingSubscription(String periodStartDate, String periodEndDate); - - /** - * Lists the invoices for a subscription. - * - * @param periodStartDate Invoice period start date. - * @param periodEndDate Invoice period end date. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of invoices. - */ - PagedIterable listByBillingSubscription(String periodStartDate, String periodEndDate, Context context); - - /** - * Gets an invoice by subscription ID and invoice ID. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by subscription ID and invoice ID. - */ - Invoice getBySubscriptionAndInvoiceId(String invoiceName); - - /** - * Gets an invoice by subscription ID and invoice ID. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an invoice by subscription ID and invoice ID. - */ - Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, Context context); - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - DownloadUrl downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken); - - /** - * Gets a URL to download an invoice. - * - * @param invoiceName The ID that uniquely identifies an invoice. - * @param downloadToken Download token with document source and document ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download an invoice. - */ - DownloadUrl downloadBillingSubscriptionInvoice(String invoiceName, String downloadToken, Context context); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - DownloadUrl downloadMultipleBillingSubscriptionInvoices(List downloadUrls); - - /** - * Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - * - * @param downloadUrls An array of download urls for individual documents. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. - */ - DownloadUrl downloadMultipleBillingSubscriptionInvoices(List downloadUrls, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadBillingSubscriptionInvoiceHeaders.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadBillingSubscriptionInvoiceHeaders.java deleted file mode 100644 index 8fc84163d9a3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadBillingSubscriptionInvoiceHeaders.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The InvoicesDownloadBillingSubscriptionInvoiceHeaders model. */ -@Fluent -public final class InvoicesDownloadBillingSubscriptionInvoiceHeaders { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(InvoicesDownloadBillingSubscriptionInvoiceHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private String retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public String retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the InvoicesDownloadBillingSubscriptionInvoiceHeaders object itself. - */ - public InvoicesDownloadBillingSubscriptionInvoiceHeaders withRetryAfter(String retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the InvoicesDownloadBillingSubscriptionInvoiceHeaders object itself. - */ - public InvoicesDownloadBillingSubscriptionInvoiceHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadBillingSubscriptionInvoiceResponse.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadBillingSubscriptionInvoiceResponse.java deleted file mode 100644 index 6962b97d010c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadBillingSubscriptionInvoiceResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; - -/** Contains all response data for the downloadBillingSubscriptionInvoice operation. */ -public final class InvoicesDownloadBillingSubscriptionInvoiceResponse - extends ResponseBase { - /** - * Creates an instance of InvoicesDownloadBillingSubscriptionInvoiceResponse. - * - * @param request the request which resulted in this InvoicesDownloadBillingSubscriptionInvoiceResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public InvoicesDownloadBillingSubscriptionInvoiceResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - DownloadUrlInner value, - InvoicesDownloadBillingSubscriptionInvoiceHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public DownloadUrlInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadInvoiceHeaders.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadInvoiceHeaders.java deleted file mode 100644 index 80bc52a4bc68..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadInvoiceHeaders.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The InvoicesDownloadInvoiceHeaders model. */ -@Fluent -public final class InvoicesDownloadInvoiceHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(InvoicesDownloadInvoiceHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private String retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public String retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the InvoicesDownloadInvoiceHeaders object itself. - */ - public InvoicesDownloadInvoiceHeaders withRetryAfter(String retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the InvoicesDownloadInvoiceHeaders object itself. - */ - public InvoicesDownloadInvoiceHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadInvoiceResponse.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadInvoiceResponse.java deleted file mode 100644 index f188f1e503a7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadInvoiceResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; - -/** Contains all response data for the downloadInvoice operation. */ -public final class InvoicesDownloadInvoiceResponse - extends ResponseBase { - /** - * Creates an instance of InvoicesDownloadInvoiceResponse. - * - * @param request the request which resulted in this InvoicesDownloadInvoiceResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public InvoicesDownloadInvoiceResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - DownloadUrlInner value, - InvoicesDownloadInvoiceHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public DownloadUrlInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingProfileInvoicesHeaders.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingProfileInvoicesHeaders.java deleted file mode 100644 index cff7c6478db0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingProfileInvoicesHeaders.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The InvoicesDownloadMultipleBillingProfileInvoicesHeaders model. */ -@Fluent -public final class InvoicesDownloadMultipleBillingProfileInvoicesHeaders { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(InvoicesDownloadMultipleBillingProfileInvoicesHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private String retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public String retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the InvoicesDownloadMultipleBillingProfileInvoicesHeaders object itself. - */ - public InvoicesDownloadMultipleBillingProfileInvoicesHeaders withRetryAfter(String retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the InvoicesDownloadMultipleBillingProfileInvoicesHeaders object itself. - */ - public InvoicesDownloadMultipleBillingProfileInvoicesHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingProfileInvoicesResponse.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingProfileInvoicesResponse.java deleted file mode 100644 index 8338b7830254..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingProfileInvoicesResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; - -/** Contains all response data for the downloadMultipleBillingProfileInvoices operation. */ -public final class InvoicesDownloadMultipleBillingProfileInvoicesResponse - extends ResponseBase { - /** - * Creates an instance of InvoicesDownloadMultipleBillingProfileInvoicesResponse. - * - * @param request the request which resulted in this InvoicesDownloadMultipleBillingProfileInvoicesResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public InvoicesDownloadMultipleBillingProfileInvoicesResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - DownloadUrlInner value, - InvoicesDownloadMultipleBillingProfileInvoicesHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public DownloadUrlInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders.java deleted file mode 100644 index 4e6063d83b42..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders model. */ -@Fluent -public final class InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private String retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public String retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders object itself. - */ - public InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders withRetryAfter(String retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders object itself. - */ - public InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse.java deleted file mode 100644 index 42e5dd1cffe6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; - -/** Contains all response data for the downloadMultipleBillingSubscriptionInvoices operation. */ -public final class InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse - extends ResponseBase { - /** - * Creates an instance of InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse. - * - * @param request the request which resulted in this InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - DownloadUrlInner value, - InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public DownloadUrlInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/MarketplacePurchasesPolicy.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/MarketplacePurchasesPolicy.java deleted file mode 100644 index 6ab3dbfabc31..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/MarketplacePurchasesPolicy.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MarketplacePurchasesPolicy. */ -public final class MarketplacePurchasesPolicy extends ExpandableStringEnum { - /** Static value AllAllowed for MarketplacePurchasesPolicy. */ - public static final MarketplacePurchasesPolicy ALL_ALLOWED = fromString("AllAllowed"); - - /** Static value OnlyFreeAllowed for MarketplacePurchasesPolicy. */ - public static final MarketplacePurchasesPolicy ONLY_FREE_ALLOWED = fromString("OnlyFreeAllowed"); - - /** Static value NotAllowed for MarketplacePurchasesPolicy. */ - public static final MarketplacePurchasesPolicy NOT_ALLOWED = fromString("NotAllowed"); - - /** - * Creates or finds a MarketplacePurchasesPolicy from its string representation. - * - * @param name a name to look for. - * @return the corresponding MarketplacePurchasesPolicy. - */ - @JsonCreator - public static MarketplacePurchasesPolicy fromString(String name) { - return fromString(name, MarketplacePurchasesPolicy.class); - } - - /** @return known MarketplacePurchasesPolicy values. */ - public static Collection values() { - return values(MarketplacePurchasesPolicy.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operation.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operation.java deleted file mode 100644 index 71956e6bb4b8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operation.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.OperationInner; - -/** An immutable client-side representation of Operation. */ -public interface Operation { - /** - * Gets the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the isDataAction property: Identifies if the operation is a data operation. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the display property: The object that represents the operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationDisplay.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationDisplay.java deleted file mode 100644 index 3d9ddb4797e2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationDisplay.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The object that represents the operation. */ -@Immutable -public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - - /* - * Service provider: Microsoft.Billing. - */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) - private String provider; - - /* - * Resource on which the operation is performed such as invoice and billing - * subscription. - */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) - private String resource; - - /* - * Operation type such as read, write and delete. - */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) - private String operation; - - /* - * Description of operation. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /** - * Get the provider property: Service provider: Microsoft.Billing. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: Resource on which the operation is performed such as invoice and billing subscription. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: Operation type such as read, write and delete. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: Description of operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationListResult.java deleted file mode 100644 index f6e3f2abf305..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationListResult.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of billing operations and a URL link to get the next set of results. */ -@Immutable -public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - - /* - * The list of billing operations supported by the Microsoft.Billing - * resource provider. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of billing operations supported by the Microsoft.Billing resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operations.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operations.java deleted file mode 100644 index 92c83f2661d8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operations.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Operations. */ -public interface Operations { - /** - * Lists the available billing REST API operations. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - PagedIterable list(); - - /** - * Lists the available billing REST API operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of billing operations and a URL link to get the next set of results. - */ - PagedIterable list(Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Participants.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Participants.java deleted file mode 100644 index 520774a3bb4b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Participants.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The details about a participant. */ -@Immutable -public final class Participants { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Participants.class); - - /* - * The acceptance status of the participant. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * The date when the status got changed. - */ - @JsonProperty(value = "statusDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime statusDate; - - /* - * The email address of the participant. - */ - @JsonProperty(value = "email", access = JsonProperty.Access.WRITE_ONLY) - private String email; - - /** - * Get the status property: The acceptance status of the participant. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the statusDate property: The date when the status got changed. - * - * @return the statusDate value. - */ - public OffsetDateTime statusDate() { - return this.statusDate; - } - - /** - * Get the email property: The email address of the participant. - * - * @return the email value. - */ - public String email() { - return this.email; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodFamily.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodFamily.java deleted file mode 100644 index d7626062ca7e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodFamily.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PaymentMethodFamily. */ -public final class PaymentMethodFamily extends ExpandableStringEnum { - /** Static value Credits for PaymentMethodFamily. */ - public static final PaymentMethodFamily CREDITS = fromString("Credits"); - - /** Static value CheckWire for PaymentMethodFamily. */ - public static final PaymentMethodFamily CHECK_WIRE = fromString("CheckWire"); - - /** Static value CreditCard for PaymentMethodFamily. */ - public static final PaymentMethodFamily CREDIT_CARD = fromString("CreditCard"); - - /** Static value None for PaymentMethodFamily. */ - public static final PaymentMethodFamily NONE = fromString("None"); - - /** - * Creates or finds a PaymentMethodFamily from its string representation. - * - * @param name a name to look for. - * @return the corresponding PaymentMethodFamily. - */ - @JsonCreator - public static PaymentMethodFamily fromString(String name) { - return fromString(name, PaymentMethodFamily.class); - } - - /** @return known PaymentMethodFamily values. */ - public static Collection values() { - return values(PaymentMethodFamily.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentProperties.java deleted file mode 100644 index c8fc84a8640d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentProperties.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a payment. */ -@Fluent -public final class PaymentProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PaymentProperties.class); - - /* - * The type of payment. - */ - @JsonProperty(value = "paymentType", access = JsonProperty.Access.WRITE_ONLY) - private String paymentType; - - /* - * The paid amount. - */ - @JsonProperty(value = "amount", access = JsonProperty.Access.WRITE_ONLY) - private Amount amount; - - /* - * The date when the payment was made. - */ - @JsonProperty(value = "date", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime date; - - /* - * The family of payment method. - */ - @JsonProperty(value = "paymentMethodFamily") - private PaymentMethodFamily paymentMethodFamily; - - /* - * The type of payment method. - */ - @JsonProperty(value = "paymentMethodType", access = JsonProperty.Access.WRITE_ONLY) - private String paymentMethodType; - - /** - * Get the paymentType property: The type of payment. - * - * @return the paymentType value. - */ - public String paymentType() { - return this.paymentType; - } - - /** - * Get the amount property: The paid amount. - * - * @return the amount value. - */ - public Amount amount() { - return this.amount; - } - - /** - * Get the date property: The date when the payment was made. - * - * @return the date value. - */ - public OffsetDateTime date() { - return this.date; - } - - /** - * Get the paymentMethodFamily property: The family of payment method. - * - * @return the paymentMethodFamily value. - */ - public PaymentMethodFamily paymentMethodFamily() { - return this.paymentMethodFamily; - } - - /** - * Set the paymentMethodFamily property: The family of payment method. - * - * @param paymentMethodFamily the paymentMethodFamily value to set. - * @return the PaymentProperties object itself. - */ - public PaymentProperties withPaymentMethodFamily(PaymentMethodFamily paymentMethodFamily) { - this.paymentMethodFamily = paymentMethodFamily; - return this; - } - - /** - * Get the paymentMethodType property: The type of payment method. - * - * @return the paymentMethodType value. - */ - public String paymentMethodType() { - return this.paymentMethodType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (amount() != null) { - amount().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Policies.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Policies.java deleted file mode 100644 index fa5e41f1795e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Policies.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; - -/** Resource collection API of Policies. */ -public interface Policies { - /** - * Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - Policy getByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, Context context); - - /** - * Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - Policy update(String billingAccountName, String billingProfileName, PolicyInner parameters); - - /** - * Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement - * type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param parameters Request parameters that are provided to the update policies operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a policy. - */ - Response updateWithResponse( - String billingAccountName, String billingProfileName, PolicyInner parameters, Context context); - - /** - * Lists the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - CustomerPolicy getByCustomer(String billingAccountName, String customerName); - - /** - * Lists the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - Response getByCustomerWithResponse(String billingAccountName, String customerName, Context context); - - /** - * Updates the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - CustomerPolicy updateCustomer(String billingAccountName, String customerName, CustomerPolicyInner parameters); - - /** - * Updates the policies for a customer. This operation is supported only for billing accounts with agreement type - * Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param parameters Request parameters that are provided to the update policies operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's Policy. - */ - Response updateCustomerWithResponse( - String billingAccountName, String customerName, CustomerPolicyInner parameters, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Policy.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Policy.java deleted file mode 100644 index d8060551acf7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Policy.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; - -/** An immutable client-side representation of Policy. */ -public interface Policy { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the marketplacePurchases property: The policy that controls whether Azure marketplace purchases are allowed - * for a billing profile. - * - * @return the marketplacePurchases value. - */ - MarketplacePurchasesPolicy marketplacePurchases(); - - /** - * Gets the reservationPurchases property: The policy that controls whether Azure reservation purchases are allowed - * for a billing profile. - * - * @return the reservationPurchases value. - */ - ReservationPurchasesPolicy reservationPurchases(); - - /** - * Gets the viewCharges property: The policy that controls whether users with Azure RBAC access to a subscription - * can view its charges. - * - * @return the viewCharges value. - */ - ViewChargesPolicy viewCharges(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.PolicyInner object. - * - * @return the inner object. - */ - PolicyInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Product.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Product.java deleted file mode 100644 index ee20cf0f2413..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Product.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of Product. */ -public interface Product { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the autoRenew property: Indicates whether auto renewal is turned on or off for a product. - * - * @return the autoRenew value. - */ - AutoRenew autoRenew(); - - /** - * Gets the displayName property: The display name of the product. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the purchaseDate property: The date when the product was purchased. - * - * @return the purchaseDate value. - */ - OffsetDateTime purchaseDate(); - - /** - * Gets the productTypeId property: The ID of the type of product. - * - * @return the productTypeId value. - */ - String productTypeId(); - - /** - * Gets the productType property: The description of the type of product. - * - * @return the productType value. - */ - String productType(); - - /** - * Gets the status property: The current status of the product. - * - * @return the status value. - */ - ProductStatusType status(); - - /** - * Gets the endDate property: The date when the product will be renewed or canceled. - * - * @return the endDate value. - */ - OffsetDateTime endDate(); - - /** - * Gets the billingFrequency property: The frequency at which the product will be billed. - * - * @return the billingFrequency value. - */ - BillingFrequency billingFrequency(); - - /** - * Gets the lastCharge property: The last month charges. - * - * @return the lastCharge value. - */ - Amount lastCharge(); - - /** - * Gets the lastChargeDate property: The date of the last charge. - * - * @return the lastChargeDate value. - */ - OffsetDateTime lastChargeDate(); - - /** - * Gets the quantity property: The quantity purchased for the product. - * - * @return the quantity value. - */ - Float quantity(); - - /** - * Gets the skuId property: The sku ID of the product. - * - * @return the skuId value. - */ - String skuId(); - - /** - * Gets the skuDescription property: The sku description of the product. - * - * @return the skuDescription value. - */ - String skuDescription(); - - /** - * Gets the tenantId property: The id of the tenant in which the product is used. - * - * @return the tenantId value. - */ - String tenantId(); - - /** - * Gets the availabilityId property: The availability of the product. - * - * @return the availabilityId value. - */ - String availabilityId(); - - /** - * Gets the invoiceSectionId property: The ID of the invoice section to which the product is billed. - * - * @return the invoiceSectionId value. - */ - String invoiceSectionId(); - - /** - * Gets the invoiceSectionDisplayName property: The name of the invoice section to which the product is billed. - * - * @return the invoiceSectionDisplayName value. - */ - String invoiceSectionDisplayName(); - - /** - * Gets the billingProfileId property: The ID of the billing profile to which the product is billed. - * - * @return the billingProfileId value. - */ - String billingProfileId(); - - /** - * Gets the billingProfileDisplayName property: The name of the billing profile to which the product is billed. - * - * @return the billingProfileDisplayName value. - */ - String billingProfileDisplayName(); - - /** - * Gets the customerId property: The ID of the customer for whom the product was purchased. The field is applicable - * only for Microsoft Partner Agreement billing account. - * - * @return the customerId value. - */ - String customerId(); - - /** - * Gets the customerDisplayName property: The name of the customer for whom the product was purchased. The field is - * applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerDisplayName value. - */ - String customerDisplayName(); - - /** - * Gets the reseller property: Reseller for this product. - * - * @return the reseller value. - */ - Reseller reseller(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.ProductInner object. - * - * @return the inner object. - */ - ProductInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductStatusType.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductStatusType.java deleted file mode 100644 index a103a0b37b6a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductStatusType.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProductStatusType. */ -public final class ProductStatusType extends ExpandableStringEnum { - /** Static value Active for ProductStatusType. */ - public static final ProductStatusType ACTIVE = fromString("Active"); - - /** Static value Inactive for ProductStatusType. */ - public static final ProductStatusType INACTIVE = fromString("Inactive"); - - /** Static value PastDue for ProductStatusType. */ - public static final ProductStatusType PAST_DUE = fromString("PastDue"); - - /** Static value Expiring for ProductStatusType. */ - public static final ProductStatusType EXPIRING = fromString("Expiring"); - - /** Static value Expired for ProductStatusType. */ - public static final ProductStatusType EXPIRED = fromString("Expired"); - - /** Static value Disabled for ProductStatusType. */ - public static final ProductStatusType DISABLED = fromString("Disabled"); - - /** Static value Cancelled for ProductStatusType. */ - public static final ProductStatusType CANCELLED = fromString("Cancelled"); - - /** Static value AutoRenew for ProductStatusType. */ - public static final ProductStatusType AUTO_RENEW = fromString("AutoRenew"); - - /** - * Creates or finds a ProductStatusType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProductStatusType. - */ - @JsonCreator - public static ProductStatusType fromString(String name) { - return fromString(name, ProductStatusType.class); - } - - /** @return known ProductStatusType values. */ - public static Collection values() { - return values(ProductStatusType.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductTransferValidationErrorCode.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductTransferValidationErrorCode.java deleted file mode 100644 index 8ab5ce76a292..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductTransferValidationErrorCode.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProductTransferValidationErrorCode. */ -public final class ProductTransferValidationErrorCode extends ExpandableStringEnum { - /** Static value InvalidSource for ProductTransferValidationErrorCode. */ - public static final ProductTransferValidationErrorCode INVALID_SOURCE = fromString("InvalidSource"); - - /** Static value ProductNotActive for ProductTransferValidationErrorCode. */ - public static final ProductTransferValidationErrorCode PRODUCT_NOT_ACTIVE = fromString("ProductNotActive"); - - /** Static value InsufficientPermissionOnSource for ProductTransferValidationErrorCode. */ - public static final ProductTransferValidationErrorCode INSUFFICIENT_PERMISSION_ON_SOURCE = - fromString("InsufficientPermissionOnSource"); - - /** Static value InsufficientPermissionOnDestination for ProductTransferValidationErrorCode. */ - public static final ProductTransferValidationErrorCode INSUFFICIENT_PERMISSION_ON_DESTINATION = - fromString("InsufficientPermissionOnDestination"); - - /** Static value DestinationBillingProfilePastDue for ProductTransferValidationErrorCode. */ - public static final ProductTransferValidationErrorCode DESTINATION_BILLING_PROFILE_PAST_DUE = - fromString("DestinationBillingProfilePastDue"); - - /** Static value ProductTypeNotSupported for ProductTransferValidationErrorCode. */ - public static final ProductTransferValidationErrorCode PRODUCT_TYPE_NOT_SUPPORTED = - fromString("ProductTypeNotSupported"); - - /** Static value CrossBillingAccountNotAllowed for ProductTransferValidationErrorCode. */ - public static final ProductTransferValidationErrorCode CROSS_BILLING_ACCOUNT_NOT_ALLOWED = - fromString("CrossBillingAccountNotAllowed"); - - /** Static value NotAvailableForDestinationMarket for ProductTransferValidationErrorCode. */ - public static final ProductTransferValidationErrorCode NOT_AVAILABLE_FOR_DESTINATION_MARKET = - fromString("NotAvailableForDestinationMarket"); - - /** Static value OneTimePurchaseProductTransferNotAllowed for ProductTransferValidationErrorCode. */ - public static final ProductTransferValidationErrorCode ONE_TIME_PURCHASE_PRODUCT_TRANSFER_NOT_ALLOWED = - fromString("OneTimePurchaseProductTransferNotAllowed"); - - /** - * Creates or finds a ProductTransferValidationErrorCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProductTransferValidationErrorCode. - */ - @JsonCreator - public static ProductTransferValidationErrorCode fromString(String name) { - return fromString(name, ProductTransferValidationErrorCode.class); - } - - /** @return known ProductTransferValidationErrorCode values. */ - public static Collection values() { - return values(ProductTransferValidationErrorCode.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Products.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Products.java deleted file mode 100644 index 5b39cb0ec326..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Products.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; - -/** Resource collection API of Products. */ -public interface Products { - /** - * Lists the products for a customer. These don't include products billed based on usage.The operation is supported - * only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - PagedIterable listByCustomer(String billingAccountName, String customerName); - - /** - * Lists the products for a customer. These don't include products billed based on usage.The operation is supported - * only for billing accounts with agreement type Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param customerName The ID that uniquely identifies a customer. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - PagedIterable listByCustomer(String billingAccountName, String customerName, Context context); - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the products for a billing account. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - PagedIterable listByBillingAccount(String billingAccountName, String filter, Context context); - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the products for a billing profile. These don't include products billed based on usage. The operation is - * supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - PagedIterable listByBillingProfile( - String billingAccountName, String billingProfileName, String filter, Context context); - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - PagedIterable listByInvoiceSection( - String billingAccountName, String billingProfileName, String invoiceSectionName); - - /** - * Lists the products for an invoice section. These don't include products billed based on usage. The operation is - * supported only for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param invoiceSectionName The ID that uniquely identifies an invoice section. - * @param filter May be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. - * It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value - * are separated by a colon (:). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of products. - */ - PagedIterable listByInvoiceSection( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String filter, - Context context); - - /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product by ID. - */ - Product get(String billingAccountName, String productName); - - /** - * Gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft Customer - * Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product by ID. - */ - Response getWithResponse(String billingAccountName, String productName, Context context); - - /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - Product update(String billingAccountName, String productName, ProductInner parameters); - - /** - * Updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only for - * billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the update product operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - Response updateWithResponse( - String billingAccountName, String productName, ProductInner parameters, Context context); - - /** - * Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported only for products that are purchased with a - * recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - Product move(String billingAccountName, String productName, TransferProductRequestProperties parameters); - - /** - * Moves a product's charges to a new invoice section. The new invoice section must belong to the same billing - * profile as the existing invoice section. This operation is supported only for products that are purchased with a - * recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the move product operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a product. - */ - Response moveWithResponse( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context); - - /** - * Validates if a product's charges can be moved to a new invoice section. This operation is supported only for - * products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the product transfer eligibility validation. - */ - ValidateProductTransferEligibilityResult validateMove( - String billingAccountName, String productName, TransferProductRequestProperties parameters); - - /** - * Validates if a product's charges can be moved to a new invoice section. This operation is supported only for - * products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft - * Customer Agreement. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param productName The ID that uniquely identifies a product. - * @param parameters Request parameters that are provided to the validate move eligibility operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the product transfer eligibility validation. - */ - Response validateMoveWithResponse( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsListResult.java deleted file mode 100644 index e7a81b44a09e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsListResult.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * The list of products. It contains a list of available product summaries in reverse chronological order by purchase - * date. - */ -@Immutable -public final class ProductsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductsListResult.class); - - /* - * The list of products. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Total number of records. - */ - @JsonProperty(value = "totalCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer totalCount; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of products. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the totalCount property: Total number of records. - * - * @return the totalCount value. - */ - public Integer totalCount() { - return this.totalCount; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsMoveHeaders.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsMoveHeaders.java deleted file mode 100644 index e2c92545cc57..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsMoveHeaders.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ProductsMoveHeaders model. */ -@Fluent -public final class ProductsMoveHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductsMoveHeaders.class); - - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the ProductsMoveHeaders object itself. - */ - public ProductsMoveHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Get the location property: The Location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The Location property. - * - * @param location the location value to set. - * @return the ProductsMoveHeaders object itself. - */ - public ProductsMoveHeaders withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsMoveResponse.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsMoveResponse.java deleted file mode 100644 index 3ebd7863dfc0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsMoveResponse.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; - -/** Contains all response data for the move operation. */ -public final class ProductsMoveResponse extends ResponseBase { - /** - * Creates an instance of ProductsMoveResponse. - * - * @param request the request which resulted in this ProductsMoveResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public ProductsMoveResponse( - HttpRequest request, int statusCode, HttpHeaders rawHeaders, ProductInner value, ProductsMoveHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** @return the deserialized response body. */ - @Override - public ProductInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/RebillDetails.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/RebillDetails.java deleted file mode 100644 index 40b49bec98db..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/RebillDetails.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The rebill details of an invoice. */ -@Immutable -public final class RebillDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RebillDetails.class); - - /* - * The ID of credit note. - */ - @JsonProperty(value = "creditNoteDocumentId", access = JsonProperty.Access.WRITE_ONLY) - private String creditNoteDocumentId; - - /* - * The ID of invoice. - */ - @JsonProperty(value = "invoiceDocumentId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceDocumentId; - - /* - * Rebill details for an invoice. - */ - @JsonProperty(value = "rebillDetails", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map rebillDetails; - - /** - * Get the creditNoteDocumentId property: The ID of credit note. - * - * @return the creditNoteDocumentId value. - */ - public String creditNoteDocumentId() { - return this.creditNoteDocumentId; - } - - /** - * Get the invoiceDocumentId property: The ID of invoice. - * - * @return the invoiceDocumentId value. - */ - public String invoiceDocumentId() { - return this.invoiceDocumentId; - } - - /** - * Get the rebillDetails property: Rebill details for an invoice. - * - * @return the rebillDetails value. - */ - public Map rebillDetails() { - return this.rebillDetails; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rebillDetails() != null) { - rebillDetails() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reseller.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reseller.java deleted file mode 100644 index 3d925897ed34..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reseller.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Details of the reseller. */ -@Immutable -public final class Reseller { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Reseller.class); - - /* - * The MPN ID of the reseller. - */ - @JsonProperty(value = "resellerId", access = JsonProperty.Access.WRITE_ONLY) - private String resellerId; - - /* - * The name of the reseller. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /** - * Get the resellerId property: The MPN ID of the reseller. - * - * @return the resellerId value. - */ - public String resellerId() { - return this.resellerId; - } - - /** - * Get the description property: The name of the reseller. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservation.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservation.java deleted file mode 100644 index fd38fb9c0dba..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservation.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.ReservationInner; -import java.util.List; - -/** An immutable client-side representation of Reservation. */ -public interface Reservation { - /** - * Gets the id property: The id of the reservation. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the reservation. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the reservation. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The location of the reservation. - * - * @return the location value. - */ - String location(); - - /** - * Gets the sku property: The sku information associated to this reservation. - * - * @return the sku value. - */ - ReservationSkuProperty sku(); - - /** - * Gets the appliedScopes property: The array of applied scopes of a reservation. Will be null if the reservation is - * in Shared scope. - * - * @return the appliedScopes value. - */ - List appliedScopes(); - - /** - * Gets the appliedScopeType property: The applied scope type of the reservation. - * - * @return the appliedScopeType value. - */ - String appliedScopeType(); - - /** - * Gets the reservedResourceType property: The reserved source type of the reservation, e.g. virtual machine. - * - * @return the reservedResourceType value. - */ - String reservedResourceType(); - - /** - * Gets the quantity property: The number of the reservation. - * - * @return the quantity value. - */ - Float quantity(); - - /** - * Gets the provisioningState property: The provisioning state of the reservation, e.g. Succeeded. - * - * @return the provisioningState value. - */ - String provisioningState(); - - /** - * Gets the expiryDate property: The expiry date of the reservation. - * - * @return the expiryDate value. - */ - String expiryDate(); - - /** - * Gets the provisioningSubState property: The provisioning state of the reservation, e.g. Succeeded. - * - * @return the provisioningSubState value. - */ - String provisioningSubState(); - - /** - * Gets the displayName property: The display name of the reservation. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the displayProvisioningState property: The provisioning state of the reservation for display, e.g. - * Succeeded. - * - * @return the displayProvisioningState value. - */ - String displayProvisioningState(); - - /** - * Gets the userFriendlyRenewState property: The renew state of the reservation for display, e.g. On. - * - * @return the userFriendlyRenewState value. - */ - String userFriendlyRenewState(); - - /** - * Gets the userFriendlyAppliedScopeType property: The applied scope type of the reservation for display, e.g. - * Shared. - * - * @return the userFriendlyAppliedScopeType value. - */ - String userFriendlyAppliedScopeType(); - - /** - * Gets the effectiveDateTime property: The effective date time of the reservation. - * - * @return the effectiveDateTime value. - */ - String effectiveDateTime(); - - /** - * Gets the skuDescription property: The sku description of the reservation. - * - * @return the skuDescription value. - */ - String skuDescription(); - - /** - * Gets the term property: The term of the reservation, e.g. P1Y. - * - * @return the term value. - */ - String term(); - - /** - * Gets the renew property: The renew state of the reservation. - * - * @return the renew value. - */ - Boolean renew(); - - /** - * Gets the renewSource property: The renew source of the reservation. - * - * @return the renewSource value. - */ - String renewSource(); - - /** - * Gets the utilization property: Reservation utilization. - * - * @return the utilization value. - */ - ReservationPropertyUtilization utilization(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.ReservationInner object. - * - * @return the inner object. - */ - ReservationInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPropertyUtilization.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPropertyUtilization.java deleted file mode 100644 index 4091bbaa950c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPropertyUtilization.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Reservation utilization. */ -@Fluent -public final class ReservationPropertyUtilization { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationPropertyUtilization.class); - - /* - * The number of days trend for a reservation - */ - @JsonProperty(value = "trend", access = JsonProperty.Access.WRITE_ONLY) - private String trend; - - /* - * The array of aggregates of a reservation's utilization - */ - @JsonProperty(value = "aggregates") - private List aggregates; - - /** - * Get the trend property: The number of days trend for a reservation. - * - * @return the trend value. - */ - public String trend() { - return this.trend; - } - - /** - * Get the aggregates property: The array of aggregates of a reservation's utilization. - * - * @return the aggregates value. - */ - public List aggregates() { - return this.aggregates; - } - - /** - * Set the aggregates property: The array of aggregates of a reservation's utilization. - * - * @param aggregates the aggregates value to set. - * @return the ReservationPropertyUtilization object itself. - */ - public ReservationPropertyUtilization withAggregates(List aggregates) { - this.aggregates = aggregates; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (aggregates() != null) { - aggregates().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPurchasesPolicy.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPurchasesPolicy.java deleted file mode 100644 index 3db5dd97924f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPurchasesPolicy.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ReservationPurchasesPolicy. */ -public final class ReservationPurchasesPolicy extends ExpandableStringEnum { - /** Static value Allowed for ReservationPurchasesPolicy. */ - public static final ReservationPurchasesPolicy ALLOWED = fromString("Allowed"); - - /** Static value NotAllowed for ReservationPurchasesPolicy. */ - public static final ReservationPurchasesPolicy NOT_ALLOWED = fromString("NotAllowed"); - - /** - * Creates or finds a ReservationPurchasesPolicy from its string representation. - * - * @param name a name to look for. - * @return the corresponding ReservationPurchasesPolicy. - */ - @JsonCreator - public static ReservationPurchasesPolicy fromString(String name) { - return fromString(name, ReservationPurchasesPolicy.class); - } - - /** @return known ReservationPurchasesPolicy values. */ - public static Collection values() { - return values(ReservationPurchasesPolicy.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationSkuProperty.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationSkuProperty.java deleted file mode 100644 index 656bbf653299..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationSkuProperty.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The property of reservation sku object. */ -@Immutable -public final class ReservationSkuProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationSkuProperty.class); - - /* - * The name of the reservation sku. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /** - * Get the name property: The name of the reservation sku. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationSummary.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationSummary.java deleted file mode 100644 index 67eb6ee38b7e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationSummary.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The roll up count summary of reservations in each state. */ -@Immutable -public final class ReservationSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationSummary.class); - - /* - * The number of reservation in Succeeded state - */ - @JsonProperty(value = "succeededCount", access = JsonProperty.Access.WRITE_ONLY) - private Float succeededCount; - - /* - * The number of reservation in Failed state - */ - @JsonProperty(value = "failedCount", access = JsonProperty.Access.WRITE_ONLY) - private Float failedCount; - - /* - * The number of reservation in Expiring state - */ - @JsonProperty(value = "expiringCount", access = JsonProperty.Access.WRITE_ONLY) - private Float expiringCount; - - /* - * The number of reservation in Expired state - */ - @JsonProperty(value = "expiredCount", access = JsonProperty.Access.WRITE_ONLY) - private Float expiredCount; - - /* - * The number of reservation in Pending state - */ - @JsonProperty(value = "pendingCount", access = JsonProperty.Access.WRITE_ONLY) - private Float pendingCount; - - /* - * The number of reservation in Cancelled state - */ - @JsonProperty(value = "cancelledCount", access = JsonProperty.Access.WRITE_ONLY) - private Float cancelledCount; - - /** - * Get the succeededCount property: The number of reservation in Succeeded state. - * - * @return the succeededCount value. - */ - public Float succeededCount() { - return this.succeededCount; - } - - /** - * Get the failedCount property: The number of reservation in Failed state. - * - * @return the failedCount value. - */ - public Float failedCount() { - return this.failedCount; - } - - /** - * Get the expiringCount property: The number of reservation in Expiring state. - * - * @return the expiringCount value. - */ - public Float expiringCount() { - return this.expiringCount; - } - - /** - * Get the expiredCount property: The number of reservation in Expired state. - * - * @return the expiredCount value. - */ - public Float expiredCount() { - return this.expiredCount; - } - - /** - * Get the pendingCount property: The number of reservation in Pending state. - * - * @return the pendingCount value. - */ - public Float pendingCount() { - return this.pendingCount; - } - - /** - * Get the cancelledCount property: The number of reservation in Cancelled state. - * - * @return the cancelledCount value. - */ - public Float cancelledCount() { - return this.cancelledCount; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationType.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationType.java deleted file mode 100644 index 3aae730572aa..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ReservationType. */ -public final class ReservationType extends ExpandableStringEnum { - /** Static value Purchase for ReservationType. */ - public static final ReservationType PURCHASE = fromString("Purchase"); - - /** Static value Usage Charge for ReservationType. */ - public static final ReservationType USAGE_CHARGE = fromString("Usage Charge"); - - /** - * Creates or finds a ReservationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ReservationType. - */ - @JsonCreator - public static ReservationType fromString(String name) { - return fromString(name, ReservationType.class); - } - - /** @return known ReservationType values. */ - public static Collection values() { - return values(ReservationType.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationUtilizationAggregates.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationUtilizationAggregates.java deleted file mode 100644 index d6db26851bf2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationUtilizationAggregates.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The aggregate values of reservation utilization. */ -@Immutable -public final class ReservationUtilizationAggregates { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationUtilizationAggregates.class); - - /* - * The grain of the aggregate - */ - @JsonProperty(value = "grain", access = JsonProperty.Access.WRITE_ONLY) - private Float grain; - - /* - * The grain unit of the aggregate - */ - @JsonProperty(value = "grainUnit", access = JsonProperty.Access.WRITE_ONLY) - private String grainUnit; - - /* - * The aggregate value - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private Float value; - - /* - * The aggregate value unit - */ - @JsonProperty(value = "valueUnit", access = JsonProperty.Access.WRITE_ONLY) - private String valueUnit; - - /** - * Get the grain property: The grain of the aggregate. - * - * @return the grain value. - */ - public Float grain() { - return this.grain; - } - - /** - * Get the grainUnit property: The grain unit of the aggregate. - * - * @return the grainUnit value. - */ - public String grainUnit() { - return this.grainUnit; - } - - /** - * Get the value property: The aggregate value. - * - * @return the value value. - */ - public Float value() { - return this.value; - } - - /** - * Get the valueUnit property: The aggregate value unit. - * - * @return the valueUnit value. - */ - public String valueUnit() { - return this.valueUnit; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservations.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservations.java deleted file mode 100644 index b18a95f43b93..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservations.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Reservations. */ -public interface Reservations { - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - PagedIterable listByBillingAccount(String billingAccountName); - - /** - * Lists the reservations for a billing account and the roll up counts of reservations group by provisioning states. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * states. - * @param selectedState The selected provisioning state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - PagedIterable listByBillingAccount( - String billingAccountName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context); - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - PagedIterable listByBillingProfile(String billingAccountName, String billingProfileName); - - /** - * Lists the reservations for a billing profile and the roll up counts of reservations group by provisioning state. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param billingProfileName The ID that uniquely identifies a billing profile. - * @param filter May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - * not currently support 'ne', 'gt', 'le', 'ge', or 'not'. - * @param orderby May be used to sort order by reservation properties. - * @param refreshSummary To indicate whether to refresh the roll up counts of the reservations group by provisioning - * state. - * @param selectedState The selected provisioning state. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of reservations and summary of roll out count of reservations in each state. - */ - PagedIterable listByBillingProfile( - String billingAccountName, - String billingProfileName, - String filter, - String orderby, - String refreshSummary, - String selectedState, - Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationsListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationsListResult.java deleted file mode 100644 index 3ee6e25ecaea..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationsListResult.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.ReservationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of reservations and summary of roll out count of reservations in each state. */ -@Fluent -public final class ReservationsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationsListResult.class); - - /* - * The list of reservations. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /* - * The roll out count summary of the reservations - */ - @JsonProperty(value = "summary") - private ReservationSummary summary; - - /** - * Get the value property: The list of reservations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the summary property: The roll out count summary of the reservations. - * - * @return the summary value. - */ - public ReservationSummary summary() { - return this.summary; - } - - /** - * Set the summary property: The roll out count summary of the reservations. - * - * @param summary the summary value to set. - * @return the ReservationsListResult object itself. - */ - public ReservationsListResult withSummary(ReservationSummary summary) { - this.summary = summary; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - if (summary() != null) { - summary().validate(); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SpendingLimit.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SpendingLimit.java deleted file mode 100644 index bc2eefb4089f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SpendingLimit.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SpendingLimit. */ -public final class SpendingLimit extends ExpandableStringEnum { - /** Static value Off for SpendingLimit. */ - public static final SpendingLimit OFF = fromString("Off"); - - /** Static value On for SpendingLimit. */ - public static final SpendingLimit ON = fromString("On"); - - /** - * Creates or finds a SpendingLimit from its string representation. - * - * @param name a name to look for. - * @return the corresponding SpendingLimit. - */ - @JsonCreator - public static SpendingLimit fromString(String name) { - return fromString(name, SpendingLimit.class); - } - - /** @return known SpendingLimit values. */ - public static Collection values() { - return values(SpendingLimit.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SpendingLimitForBillingProfile.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SpendingLimitForBillingProfile.java deleted file mode 100644 index 736007d66636..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SpendingLimitForBillingProfile.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SpendingLimitForBillingProfile. */ -public final class SpendingLimitForBillingProfile extends ExpandableStringEnum { - /** Static value Off for SpendingLimitForBillingProfile. */ - public static final SpendingLimitForBillingProfile OFF = fromString("Off"); - - /** Static value On for SpendingLimitForBillingProfile. */ - public static final SpendingLimitForBillingProfile ON = fromString("On"); - - /** - * Creates or finds a SpendingLimitForBillingProfile from its string representation. - * - * @param name a name to look for. - * @return the corresponding SpendingLimitForBillingProfile. - */ - @JsonCreator - public static SpendingLimitForBillingProfile fromString(String name) { - return fromString(name, SpendingLimitForBillingProfile.class); - } - - /** @return known SpendingLimitForBillingProfile values. */ - public static Collection values() { - return values(SpendingLimitForBillingProfile.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/StatusReasonCode.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/StatusReasonCode.java deleted file mode 100644 index 19e9b366d610..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/StatusReasonCode.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for StatusReasonCode. */ -public final class StatusReasonCode extends ExpandableStringEnum { - /** Static value PastDue for StatusReasonCode. */ - public static final StatusReasonCode PAST_DUE = fromString("PastDue"); - - /** Static value SpendingLimitReached for StatusReasonCode. */ - public static final StatusReasonCode SPENDING_LIMIT_REACHED = fromString("SpendingLimitReached"); - - /** Static value SpendingLimitExpired for StatusReasonCode. */ - public static final StatusReasonCode SPENDING_LIMIT_EXPIRED = fromString("SpendingLimitExpired"); - - /** - * Creates or finds a StatusReasonCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding StatusReasonCode. - */ - @JsonCreator - public static StatusReasonCode fromString(String name) { - return fromString(name, StatusReasonCode.class); - } - - /** @return known StatusReasonCode values. */ - public static Collection values() { - return values(StatusReasonCode.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/StatusReasonCodeForBillingProfile.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/StatusReasonCodeForBillingProfile.java deleted file mode 100644 index c09ba125b96c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/StatusReasonCodeForBillingProfile.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for StatusReasonCodeForBillingProfile. */ -public final class StatusReasonCodeForBillingProfile extends ExpandableStringEnum { - /** Static value PastDue for StatusReasonCodeForBillingProfile. */ - public static final StatusReasonCodeForBillingProfile PAST_DUE = fromString("PastDue"); - - /** Static value SpendingLimitReached for StatusReasonCodeForBillingProfile. */ - public static final StatusReasonCodeForBillingProfile SPENDING_LIMIT_REACHED = fromString("SpendingLimitReached"); - - /** Static value SpendingLimitExpired for StatusReasonCodeForBillingProfile. */ - public static final StatusReasonCodeForBillingProfile SPENDING_LIMIT_EXPIRED = fromString("SpendingLimitExpired"); - - /** - * Creates or finds a StatusReasonCodeForBillingProfile from its string representation. - * - * @param name a name to look for. - * @return the corresponding StatusReasonCodeForBillingProfile. - */ - @JsonCreator - public static StatusReasonCodeForBillingProfile fromString(String name) { - return fromString(name, StatusReasonCodeForBillingProfile.class); - } - - /** @return known StatusReasonCodeForBillingProfile values. */ - public static Collection values() { - return values(StatusReasonCodeForBillingProfile.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SubscriptionTransferValidationErrorCode.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SubscriptionTransferValidationErrorCode.java deleted file mode 100644 index 1ef1a25c3611..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SubscriptionTransferValidationErrorCode.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SubscriptionTransferValidationErrorCode. */ -public final class SubscriptionTransferValidationErrorCode - extends ExpandableStringEnum { - /** Static value BillingAccountInactive for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode BILLING_ACCOUNT_INACTIVE = - fromString("BillingAccountInactive"); - - /** Static value CrossBillingAccountNotAllowed for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode CROSS_BILLING_ACCOUNT_NOT_ALLOWED = - fromString("CrossBillingAccountNotAllowed"); - - /** Static value DestinationBillingProfileInactive for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode DESTINATION_BILLING_PROFILE_INACTIVE = - fromString("DestinationBillingProfileInactive"); - - /** Static value DestinationBillingProfileNotFound for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode DESTINATION_BILLING_PROFILE_NOT_FOUND = - fromString("DestinationBillingProfileNotFound"); - - /** Static value DestinationBillingProfilePastDue for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode DESTINATION_BILLING_PROFILE_PAST_DUE = - fromString("DestinationBillingProfilePastDue"); - - /** Static value DestinationInvoiceSectionInactive for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode DESTINATION_INVOICE_SECTION_INACTIVE = - fromString("DestinationInvoiceSectionInactive"); - - /** Static value DestinationInvoiceSectionNotFound for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode DESTINATION_INVOICE_SECTION_NOT_FOUND = - fromString("DestinationInvoiceSectionNotFound"); - - /** Static value InsufficientPermissionOnDestination for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode INSUFFICIENT_PERMISSION_ON_DESTINATION = - fromString("InsufficientPermissionOnDestination"); - - /** Static value InsufficientPermissionOnSource for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode INSUFFICIENT_PERMISSION_ON_SOURCE = - fromString("InsufficientPermissionOnSource"); - - /** Static value InvalidDestination for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode INVALID_DESTINATION = fromString("InvalidDestination"); - - /** Static value InvalidSource for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode INVALID_SOURCE = fromString("InvalidSource"); - - /** Static value MarketplaceNotEnabledOnDestination for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode MARKETPLACE_NOT_ENABLED_ON_DESTINATION = - fromString("MarketplaceNotEnabledOnDestination"); - - /** Static value NotAvailableForDestinationMarket for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode NOT_AVAILABLE_FOR_DESTINATION_MARKET = - fromString("NotAvailableForDestinationMarket"); - - /** Static value ProductInactive for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode PRODUCT_INACTIVE = fromString("ProductInactive"); - - /** Static value ProductNotFound for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode PRODUCT_NOT_FOUND = fromString("ProductNotFound"); - - /** Static value ProductTypeNotSupported for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode PRODUCT_TYPE_NOT_SUPPORTED = - fromString("ProductTypeNotSupported"); - - /** Static value SourceBillingProfilePastDue for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode SOURCE_BILLING_PROFILE_PAST_DUE = - fromString("SourceBillingProfilePastDue"); - - /** Static value SourceInvoiceSectionInactive for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode SOURCE_INVOICE_SECTION_INACTIVE = - fromString("SourceInvoiceSectionInactive"); - - /** Static value SubscriptionNotActive for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode SUBSCRIPTION_NOT_ACTIVE = - fromString("SubscriptionNotActive"); - - /** Static value SubscriptionTypeNotSupported for SubscriptionTransferValidationErrorCode. */ - public static final SubscriptionTransferValidationErrorCode SUBSCRIPTION_TYPE_NOT_SUPPORTED = - fromString("SubscriptionTypeNotSupported"); - - /** - * Creates or finds a SubscriptionTransferValidationErrorCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding SubscriptionTransferValidationErrorCode. - */ - @JsonCreator - public static SubscriptionTransferValidationErrorCode fromString(String name) { - return fromString(name, SubscriptionTransferValidationErrorCode.class); - } - - /** @return known SubscriptionTransferValidationErrorCode values. */ - public static Collection values() { - return values(SubscriptionTransferValidationErrorCode.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TargetCloud.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TargetCloud.java deleted file mode 100644 index 1ce20b9cfb7c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TargetCloud.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TargetCloud. */ -public final class TargetCloud extends ExpandableStringEnum { - /** Static value USGov for TargetCloud. */ - public static final TargetCloud USGOV = fromString("USGov"); - - /** Static value USNat for TargetCloud. */ - public static final TargetCloud USNAT = fromString("USNat"); - - /** Static value USSec for TargetCloud. */ - public static final TargetCloud USSEC = fromString("USSec"); - - /** - * Creates or finds a TargetCloud from its string representation. - * - * @param name a name to look for. - * @return the corresponding TargetCloud. - */ - @JsonCreator - public static TargetCloud fromString(String name) { - return fromString(name, TargetCloud.class); - } - - /** @return known TargetCloud values. */ - public static Collection values() { - return values(TargetCloud.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Transaction.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Transaction.java deleted file mode 100644 index 0da0e3d3afe9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Transaction.java +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.TransactionInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of Transaction. */ -public interface Transaction { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the kind property: The kind of transaction. Options are all or reservation. - * - * @return the kind value. - */ - TransactionTypeKind kind(); - - /** - * Gets the date property: The date of transaction. - * - * @return the date value. - */ - OffsetDateTime date(); - - /** - * Gets the invoice property: Invoice on which the transaction was billed or 'pending' if the transaction is not - * billed. - * - * @return the invoice value. - */ - String invoice(); - - /** - * Gets the invoiceId property: The ID of the invoice on which the transaction was billed. This field is only - * applicable for transactions which are billed. - * - * @return the invoiceId value. - */ - String invoiceId(); - - /** - * Gets the orderId property: The order ID of the reservation. The field is only applicable for transaction of kind - * reservation. - * - * @return the orderId value. - */ - String orderId(); - - /** - * Gets the orderName property: The name of the reservation order. The field is only applicable for transactions of - * kind reservation. - * - * @return the orderName value. - */ - String orderName(); - - /** - * Gets the productFamily property: The family of the product for which the transaction took place. - * - * @return the productFamily value. - */ - String productFamily(); - - /** - * Gets the productTypeId property: The ID of the product type for which the transaction took place. - * - * @return the productTypeId value. - */ - String productTypeId(); - - /** - * Gets the productType property: The type of the product for which the transaction took place. - * - * @return the productType value. - */ - String productType(); - - /** - * Gets the productDescription property: The description of the product for which the transaction took place. - * - * @return the productDescription value. - */ - String productDescription(); - - /** - * Gets the transactionType property: The type of transaction. - * - * @return the transactionType value. - */ - ReservationType transactionType(); - - /** - * Gets the transactionAmount property: The charge associated with the transaction. - * - * @return the transactionAmount value. - */ - Amount transactionAmount(); - - /** - * Gets the quantity property: The quantity purchased in the transaction. - * - * @return the quantity value. - */ - Integer quantity(); - - /** - * Gets the invoiceSectionId property: The ID of the invoice section which will be billed for the transaction. - * - * @return the invoiceSectionId value. - */ - String invoiceSectionId(); - - /** - * Gets the invoiceSectionDisplayName property: The name of the invoice section which will be billed for the - * transaction. - * - * @return the invoiceSectionDisplayName value. - */ - String invoiceSectionDisplayName(); - - /** - * Gets the billingProfileId property: The ID of the billing profile which will be billed for the transaction. - * - * @return the billingProfileId value. - */ - String billingProfileId(); - - /** - * Gets the billingProfileDisplayName property: The name of the billing profile which will be billed for the - * transaction. - * - * @return the billingProfileDisplayName value. - */ - String billingProfileDisplayName(); - - /** - * Gets the customerId property: The ID of the customer for which the transaction took place. The field is - * applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerId value. - */ - String customerId(); - - /** - * Gets the customerDisplayName property: The name of the customer for which the transaction took place. The field - * is applicable only for Microsoft Partner Agreement billing account. - * - * @return the customerDisplayName value. - */ - String customerDisplayName(); - - /** - * Gets the subscriptionId property: The ID of the subscription that was used for the transaction. The field is only - * applicable for transaction of kind reservation. - * - * @return the subscriptionId value. - */ - String subscriptionId(); - - /** - * Gets the subscriptionName property: The name of the subscription that was used for the transaction. The field is - * only applicable for transaction of kind reservation. - * - * @return the subscriptionName value. - */ - String subscriptionName(); - - /** - * Gets the azurePlan property: The type of azure plan of the subscription that was used for the transaction. - * - * @return the azurePlan value. - */ - String azurePlan(); - - /** - * Gets the azureCreditApplied property: The amount of any Azure credits automatically applied to this transaction. - * - * @return the azureCreditApplied value. - */ - Amount azureCreditApplied(); - - /** - * Gets the billingCurrency property: The ISO 4217 code for the currency in which this transaction is billed. - * - * @return the billingCurrency value. - */ - String billingCurrency(); - - /** - * Gets the discount property: The percentage discount, if any, applied to this transaction. - * - * @return the discount value. - */ - Float discount(); - - /** - * Gets the effectivePrice property: The price of the product after applying any discounts. - * - * @return the effectivePrice value. - */ - Amount effectivePrice(); - - /** - * Gets the exchangeRate property: The exchange rate used to convert charged amount to billing currency, if - * applicable. - * - * @return the exchangeRate value. - */ - Float exchangeRate(); - - /** - * Gets the marketPrice property: The retail price of the product. - * - * @return the marketPrice value. - */ - Amount marketPrice(); - - /** - * Gets the pricingCurrency property: The ISO 4217 code for the currency in which the product is priced. - * - * @return the pricingCurrency value. - */ - String pricingCurrency(); - - /** - * Gets the servicePeriodStartDate property: The date of the purchase of the product, or the start date of the month - * in which usage started. - * - * @return the servicePeriodStartDate value. - */ - OffsetDateTime servicePeriodStartDate(); - - /** - * Gets the servicePeriodEndDate property: The end date of the product term, or the end date of the month in which - * usage ended. - * - * @return the servicePeriodEndDate value. - */ - OffsetDateTime servicePeriodEndDate(); - - /** - * Gets the subTotal property: The pre-tax charged amount for the transaction. - * - * @return the subTotal value. - */ - Amount subTotal(); - - /** - * Gets the tax property: The tax amount applied to the transaction. - * - * @return the tax value. - */ - Amount tax(); - - /** - * Gets the unitOfMeasure property: The unit of measure used to bill for the product. For example, compute services - * are billed per hour. - * - * @return the unitOfMeasure value. - */ - String unitOfMeasure(); - - /** - * Gets the units property: The number of units used for a given product. - * - * @return the units value. - */ - Float units(); - - /** - * Gets the unitType property: The description for the unit of measure for a given product. - * - * @return the unitType value. - */ - String unitType(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.TransactionInner object. - * - * @return the inner object. - */ - TransactionInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionListResult.java deleted file mode 100644 index 45e11fd7eda1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionListResult.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.billing.fluent.models.TransactionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of transactions. */ -@Immutable -public final class TransactionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransactionListResult.class); - - /* - * The list of transactions. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * Total number of records. - */ - @JsonProperty(value = "totalCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer totalCount; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: The list of transactions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the totalCount property: Total number of records. - * - * @return the totalCount value. - */ - public Integer totalCount() { - return this.totalCount; - } - - /** - * Get the nextLink property: The link (url) to the next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionTypeKind.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionTypeKind.java deleted file mode 100644 index 1690605d16dc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionTypeKind.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TransactionTypeKind. */ -public final class TransactionTypeKind extends ExpandableStringEnum { - /** Static value all for TransactionTypeKind. */ - public static final TransactionTypeKind ALL = fromString("all"); - - /** Static value reservation for TransactionTypeKind. */ - public static final TransactionTypeKind RESERVATION = fromString("reservation"); - - /** - * Creates or finds a TransactionTypeKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding TransactionTypeKind. - */ - @JsonCreator - public static TransactionTypeKind fromString(String name) { - return fromString(name, TransactionTypeKind.class); - } - - /** @return known TransactionTypeKind values. */ - public static Collection values() { - return values(TransactionTypeKind.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Transactions.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Transactions.java deleted file mode 100644 index 8b2a1f219b40..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Transactions.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Transactions. */ -public interface Transactions { - /** - * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - PagedIterable listByInvoice(String billingAccountName, String invoiceName); - - /** - * Lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges. - * - * @param billingAccountName The ID that uniquely identifies a billing account. - * @param invoiceName The ID that uniquely identifies an invoice. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of transactions. - */ - PagedIterable listByInvoice(String billingAccountName, String invoiceName, Context context); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransferBillingSubscriptionRequestProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransferBillingSubscriptionRequestProperties.java deleted file mode 100644 index 5c9d8529cd71..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransferBillingSubscriptionRequestProperties.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request parameters to transfer billing subscription. */ -@Fluent -public final class TransferBillingSubscriptionRequestProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(TransferBillingSubscriptionRequestProperties.class); - - /* - * The destination invoice section id. - */ - @JsonProperty(value = "destinationInvoiceSectionId", required = true) - private String destinationInvoiceSectionId; - - /** - * Get the destinationInvoiceSectionId property: The destination invoice section id. - * - * @return the destinationInvoiceSectionId value. - */ - public String destinationInvoiceSectionId() { - return this.destinationInvoiceSectionId; - } - - /** - * Set the destinationInvoiceSectionId property: The destination invoice section id. - * - * @param destinationInvoiceSectionId the destinationInvoiceSectionId value to set. - * @return the TransferBillingSubscriptionRequestProperties object itself. - */ - public TransferBillingSubscriptionRequestProperties withDestinationInvoiceSectionId( - String destinationInvoiceSectionId) { - this.destinationInvoiceSectionId = destinationInvoiceSectionId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (destinationInvoiceSectionId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property destinationInvoiceSectionId in model" - + " TransferBillingSubscriptionRequestProperties")); - } - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransferProductRequestProperties.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransferProductRequestProperties.java deleted file mode 100644 index eec0db1652f8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransferProductRequestProperties.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of the product to initiate a transfer. */ -@Fluent -public final class TransferProductRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransferProductRequestProperties.class); - - /* - * The destination invoice section id. - */ - @JsonProperty(value = "destinationInvoiceSectionId") - private String destinationInvoiceSectionId; - - /** - * Get the destinationInvoiceSectionId property: The destination invoice section id. - * - * @return the destinationInvoiceSectionId value. - */ - public String destinationInvoiceSectionId() { - return this.destinationInvoiceSectionId; - } - - /** - * Set the destinationInvoiceSectionId property: The destination invoice section id. - * - * @param destinationInvoiceSectionId the destinationInvoiceSectionId value to set. - * @return the TransferProductRequestProperties object itself. - */ - public TransferProductRequestProperties withDestinationInvoiceSectionId(String destinationInvoiceSectionId) { - this.destinationInvoiceSectionId = destinationInvoiceSectionId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateAddressResponse.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateAddressResponse.java deleted file mode 100644 index 3568073aac16..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateAddressResponse.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.ValidateAddressResponseInner; -import java.util.List; - -/** An immutable client-side representation of ValidateAddressResponse. */ -public interface ValidateAddressResponse { - /** - * Gets the status property: status of the address validation. - * - * @return the status value. - */ - AddressValidationStatus status(); - - /** - * Gets the suggestedAddresses property: The list of suggested addresses. - * - * @return the suggestedAddresses value. - */ - List suggestedAddresses(); - - /** - * Gets the validationMessage property: Validation error message. - * - * @return the validationMessage value. - */ - String validationMessage(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.ValidateAddressResponseInner object. - * - * @return the inner object. - */ - ValidateAddressResponseInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityError.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityError.java deleted file mode 100644 index 4791cff63ce6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityError.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Error details of the product transfer eligibility validation. */ -@Fluent -public final class ValidateProductTransferEligibilityError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateProductTransferEligibilityError.class); - - /* - * Error code for the product transfer validation. - */ - @JsonProperty(value = "code") - private ProductTransferValidationErrorCode code; - - /* - * The error message. - */ - @JsonProperty(value = "message") - private String message; - - /* - * Detailed error message explaining the error. - */ - @JsonProperty(value = "details") - private String details; - - /** - * Get the code property: Error code for the product transfer validation. - * - * @return the code value. - */ - public ProductTransferValidationErrorCode code() { - return this.code; - } - - /** - * Set the code property: Error code for the product transfer validation. - * - * @param code the code value to set. - * @return the ValidateProductTransferEligibilityError object itself. - */ - public ValidateProductTransferEligibilityError withCode(ProductTransferValidationErrorCode code) { - this.code = code; - return this; - } - - /** - * Get the message property: The error message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: The error message. - * - * @param message the message value to set. - * @return the ValidateProductTransferEligibilityError object itself. - */ - public ValidateProductTransferEligibilityError withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the details property: Detailed error message explaining the error. - * - * @return the details value. - */ - public String details() { - return this.details; - } - - /** - * Set the details property: Detailed error message explaining the error. - * - * @param details the details value to set. - * @return the ValidateProductTransferEligibilityError object itself. - */ - public ValidateProductTransferEligibilityError withDetails(String details) { - this.details = details; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityResult.java deleted file mode 100644 index 57f3bc348565..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateProductTransferEligibilityResult.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.ValidateProductTransferEligibilityResultInner; - -/** An immutable client-side representation of ValidateProductTransferEligibilityResult. */ -public interface ValidateProductTransferEligibilityResult { - /** - * Gets the isMoveEligible property: Specifies whether the transfer is eligible or not. - * - * @return the isMoveEligible value. - */ - Boolean isMoveEligible(); - - /** - * Gets the errorDetails property: Validation error details. - * - * @return the errorDetails value. - */ - ValidateProductTransferEligibilityError errorDetails(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.ValidateProductTransferEligibilityResultInner - * object. - * - * @return the inner object. - */ - ValidateProductTransferEligibilityResultInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityError.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityError.java deleted file mode 100644 index e1453c963477..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityError.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Error details of the transfer eligibility validation. */ -@Fluent -public final class ValidateSubscriptionTransferEligibilityError { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateSubscriptionTransferEligibilityError.class); - - /* - * Error code for the product transfer validation. - */ - @JsonProperty(value = "code") - private SubscriptionTransferValidationErrorCode code; - - /* - * The error message. - */ - @JsonProperty(value = "message") - private String message; - - /* - * Detailed error message explaining the error. - */ - @JsonProperty(value = "details") - private String details; - - /** - * Get the code property: Error code for the product transfer validation. - * - * @return the code value. - */ - public SubscriptionTransferValidationErrorCode code() { - return this.code; - } - - /** - * Set the code property: Error code for the product transfer validation. - * - * @param code the code value to set. - * @return the ValidateSubscriptionTransferEligibilityError object itself. - */ - public ValidateSubscriptionTransferEligibilityError withCode(SubscriptionTransferValidationErrorCode code) { - this.code = code; - return this; - } - - /** - * Get the message property: The error message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: The error message. - * - * @param message the message value to set. - * @return the ValidateSubscriptionTransferEligibilityError object itself. - */ - public ValidateSubscriptionTransferEligibilityError withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the details property: Detailed error message explaining the error. - * - * @return the details value. - */ - public String details() { - return this.details; - } - - /** - * Set the details property: Detailed error message explaining the error. - * - * @param details the details value to set. - * @return the ValidateSubscriptionTransferEligibilityError object itself. - */ - public ValidateSubscriptionTransferEligibilityError withDetails(String details) { - this.details = details; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityResult.java deleted file mode 100644 index a090986d8003..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityResult.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.resourcemanager.billing.fluent.models.ValidateSubscriptionTransferEligibilityResultInner; - -/** An immutable client-side representation of ValidateSubscriptionTransferEligibilityResult. */ -public interface ValidateSubscriptionTransferEligibilityResult { - /** - * Gets the isMoveEligible property: Specifies whether the subscription is eligible to be transferred. - * - * @return the isMoveEligible value. - */ - Boolean isMoveEligible(); - - /** - * Gets the errorDetails property: Validation error details. - * - * @return the errorDetails value. - */ - ValidateSubscriptionTransferEligibilityError errorDetails(); - - /** - * Gets the inner com.azure.resourcemanager.billing.fluent.models.ValidateSubscriptionTransferEligibilityResultInner - * object. - * - * @return the inner object. - */ - ValidateSubscriptionTransferEligibilityResultInner innerModel(); -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ViewCharges.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ViewCharges.java deleted file mode 100644 index bb7d5614f78c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ViewCharges.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ViewCharges. */ -public final class ViewCharges extends ExpandableStringEnum { - /** Static value Allowed for ViewCharges. */ - public static final ViewCharges ALLOWED = fromString("Allowed"); - - /** Static value NotAllowed for ViewCharges. */ - public static final ViewCharges NOT_ALLOWED = fromString("NotAllowed"); - - /** - * Creates or finds a ViewCharges from its string representation. - * - * @param name a name to look for. - * @return the corresponding ViewCharges. - */ - @JsonCreator - public static ViewCharges fromString(String name) { - return fromString(name, ViewCharges.class); - } - - /** @return known ViewCharges values. */ - public static Collection values() { - return values(ViewCharges.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ViewChargesPolicy.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ViewChargesPolicy.java deleted file mode 100644 index 1d1c67748f39..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ViewChargesPolicy.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ViewChargesPolicy. */ -public final class ViewChargesPolicy extends ExpandableStringEnum { - /** Static value Allowed for ViewChargesPolicy. */ - public static final ViewChargesPolicy ALLOWED = fromString("Allowed"); - - /** Static value NotAllowed for ViewChargesPolicy. */ - public static final ViewChargesPolicy NOT_ALLOWED = fromString("NotAllowed"); - - /** - * Creates or finds a ViewChargesPolicy from its string representation. - * - * @param name a name to look for. - * @return the corresponding ViewChargesPolicy. - */ - @JsonCreator - public static ViewChargesPolicy fromString(String name) { - return fromString(name, ViewChargesPolicy.class); - } - - /** @return known ViewChargesPolicy values. */ - public static Collection values() { - return values(ViewChargesPolicy.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/package-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/package-info.java deleted file mode 100644 index 5bd18ba90978..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the data models for BillingManagementClient. Billing client provides access to billing resources - * for Azure subscriptions. - */ -package com.azure.resourcemanager.billing.models; diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/package-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/package-info.java deleted file mode 100644 index 85bcbed59250..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the classes for BillingManagementClient. Billing client provides access to billing resources for - * Azure subscriptions. - */ -package com.azure.resourcemanager.billing; diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/module-info.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/module-info.java deleted file mode 100644 index 30adadf3320f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/module-info.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -module com.azure.resourcemanager.billing { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.billing; - exports com.azure.resourcemanager.billing.fluent; - exports com.azure.resourcemanager.billing.fluent.models; - exports com.azure.resourcemanager.billing.models; - - opens com.azure.resourcemanager.billing.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.billing.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AddressValidateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AddressValidateSamples.java deleted file mode 100644 index c405c0dfdfda..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AddressValidateSamples.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.models.AddressDetails; - -/** Samples for Address Validate. */ -public final class AddressValidateSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressInvalid.json - */ - /** - * Sample code: AddressInvalid. - * - * @param manager Entry point to BillingManager. - */ - public static void addressInvalid(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .address() - .validateWithResponse( - new AddressDetails() - .withAddressLine1("1 Test") - .withCity("bellevue") - .withRegion("wa") - .withCountry("us") - .withPostalCode("12345"), - Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressValid.json - */ - /** - * Sample code: AddressValid. - * - * @param manager Entry point to BillingManager. - */ - public static void addressValid(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .address() - .validateWithResponse( - new AddressDetails() - .withAddressLine1("1 Test Address") - .withCity("bellevue") - .withRegion("wa") - .withCountry("us") - .withPostalCode("12345"), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsGetSamples.java deleted file mode 100644 index 20e7bd073a74..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Agreements Get. */ -public final class AgreementsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementByName.json - */ - /** - * Sample code: AgreementByName. - * - * @param manager Entry point to BillingManager. - */ - public static void agreementByName(com.azure.resourcemanager.billing.BillingManager manager) { - manager.agreements().getWithResponse("{billingAccountName}", "{agreementName}", null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountSamples.java deleted file mode 100644 index 126f790617eb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Agreements ListByBillingAccount. */ -public final class AgreementsListByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementsListByBillingAccount.json - */ - /** - * Sample code: AgreementsListByBillingAccount. - * - * @param manager Entry point to BillingManager. - */ - public static void agreementsListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { - manager.agreements().listByBillingAccount("{billingAccountName}", null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetSamples.java deleted file mode 100644 index 89043becf2d9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for AvailableBalances Get. */ -public final class AvailableBalancesGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json - */ - /** - * Sample code: AvailableBalanceByBillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void availableBalanceByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { - manager.availableBalances().getWithResponse("{billingAccountName}", "{billingProfileName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsGetSamples.java deleted file mode 100644 index 2aded981e131..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsGetSamples.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingAccounts Get. */ -public final class BillingAccountsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountWithExpand.json - */ - /** - * Sample code: BillingAccountWithExpand. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingAccounts() - .getWithResponse( - "{billingAccountName}", "soldTo,billingProfiles,billingProfiles/invoiceSections", Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccount.json - */ - /** - * Sample code: BillingAccounts. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccounts(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingAccounts().getWithResponse("{billingAccountName}", null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples.java deleted file mode 100644 index 0958fb55354c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingAccounts ListInvoiceSectionsByCreateSubscriptionPermission. */ -public final class BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListWithCreateSubPermission.json - */ - /** - * Sample code: InvoiceSectionsListWithCreateSubPermission. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceSectionsListWithCreateSubPermission( - com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingAccounts() - .listInvoiceSectionsByCreateSubscriptionPermission("{billingAccountName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListSamples.java deleted file mode 100644 index ac145035c7e5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListSamples.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingAccounts List. */ -public final class BillingAccountsListSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsList.json - */ - /** - * Sample code: BillingAccountsList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingAccounts().list(null, Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpandForEnrollmentDetails.json - */ - /** - * Sample code: BillingAccountsListWithExpandForEnrollmentDetails. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountsListWithExpandForEnrollmentDetails( - com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingAccounts().list("enrollmentDetails,departments,enrollmentAccounts", Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpand.json - */ - /** - * Sample code: BillingAccountsListWithExpand. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountsListWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingAccounts().list("soldTo,billingProfiles,billingProfiles/invoiceSections", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsUpdateSamples.java deleted file mode 100644 index 36470d11a11e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsUpdateSamples.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.BillingAccountUpdateRequest; - -/** Samples for BillingAccounts Update. */ -public final class BillingAccountsUpdateSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingAccount.json - */ - /** - * Sample code: UpdateBillingAccount. - * - * @param manager Entry point to BillingManager. - */ - public static void updateBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingAccounts() - .update( - "{billingAccountName}", - new BillingAccountUpdateRequest() - .withDisplayName("Test Account") - .withSoldTo( - new AddressDetails() - .withFirstName("Test") - .withLastName("User") - .withCompanyName("Contoso") - .withAddressLine1("Test Address 1") - .withCity("Redmond") - .withRegion("WA") - .withCountry("US") - .withPostalCode("12345")), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetSamples.java deleted file mode 100644 index e18ecd2f2cbc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingPeriods Get. */ -public final class BillingPeriodsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsGet.json - */ - /** - * Sample code: BillingPeriodsGet. - * - * @param manager Entry point to BillingManager. - */ - public static void billingPeriodsGet(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingPeriods().getWithResponse("201702-1", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListSamples.java deleted file mode 100644 index 5dece15fabbf..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingPeriods List. */ -public final class BillingPeriodsListSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsList.json - */ - /** - * Sample code: BillingPeriodsList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingPeriodsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingPeriods().list(null, null, null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountSamples.java deleted file mode 100644 index 805a5b5cba7c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingPermissions ListByBillingAccount. */ -public final class BillingPermissionsListByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountPermissionsList.json - */ - /** - * Sample code: BillingAccountPermissionsList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountPermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingPermissions().listByBillingAccount("{billingAccountName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileSamples.java deleted file mode 100644 index 0d7a3532123d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingPermissions ListByBillingProfile. */ -public final class BillingPermissionsListByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilePermissionsList.json - */ - /** - * Sample code: BillingProfilePermissionsList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfilePermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingPermissions().listByBillingProfile("{billingAccountName}", "{billingProfileName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerSamples.java deleted file mode 100644 index f420687098fc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingPermissions ListByCustomer. */ -public final class BillingPermissionsListByCustomerSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPermissionsList.json - */ - /** - * Sample code: BillingProfilePermissionsList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfilePermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingPermissions().listByCustomer("{billingAccountName}", "{customerName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsSamples.java deleted file mode 100644 index d375561df6be..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingPermissions ListByInvoiceSections. */ -public final class BillingPermissionsListByInvoiceSectionsSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionPermissionsList.json - */ - /** - * Sample code: InvoiceSectionPermissionsList. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceSectionPermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingPermissions() - .listByInvoiceSections( - "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesCreateOrUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesCreateOrUpdateSamples.java deleted file mode 100644 index 30df7e8fe020..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesCreateOrUpdateSamples.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingProfileInner; -import com.azure.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.AzurePlan; -import java.util.Arrays; - -/** Samples for BillingProfiles CreateOrUpdate. */ -public final class BillingProfilesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutBillingProfile.json - */ - /** - * Sample code: CreateBillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void createBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingProfiles() - .createOrUpdate( - "{billingAccountName}", - "{billingProfileName}", - new BillingProfileInner() - .withDisplayName("Finance") - .withPoNumber("ABC12345") - .withBillTo( - new AddressDetails() - .withFirstName("Test") - .withLastName("User") - .withAddressLine1("Test Address 1") - .withCity("Redmond") - .withRegion("WA") - .withCountry("US") - .withPostalCode("12345")) - .withInvoiceEmailOptIn(true) - .withEnabledAzurePlans( - Arrays.asList(new AzurePlan().withSkuId("0001"), new AzurePlan().withSkuId("0002"))), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesGetSamples.java deleted file mode 100644 index 34503cecc163..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesGetSamples.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingProfiles Get. */ -public final class BillingProfilesGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileWithExpand.json - */ - /** - * Sample code: BillingProfileWithExpand. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfileWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingProfiles() - .getWithResponse("{billingAccountName}", "{billingProfileName}", "invoiceSections", Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfile.json - */ - /** - * Sample code: BillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfile(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingProfiles().getWithResponse("{billingAccountName}", "{billingProfileName}", null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesListByBillingAccountSamples.java deleted file mode 100644 index 260c5d146590..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesListByBillingAccountSamples.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingProfiles ListByBillingAccount. */ -public final class BillingProfilesListByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListWithExpand.json - */ - /** - * Sample code: BillingProfilesListWithExpand. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfilesListWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingProfiles().listByBillingAccount("{billingAccountName}", "invoiceSections", Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListByBillingAccount.json - */ - /** - * Sample code: BillingProfilesListByBillingAccount. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfilesListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingProfiles().listByBillingAccount("{billingAccountName}", null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyGetSamples.java deleted file mode 100644 index a0782cd71d77..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingProperty Get. */ -public final class BillingPropertyGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProperty.json - */ - /** - * Sample code: BillingProperty. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProperty(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingProperties().getWithResponse(Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyUpdateSamples.java deleted file mode 100644 index 42213397b055..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyUpdateSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingPropertyInner; - -/** Samples for BillingProperty Update. */ -public final class BillingPropertyUpdateSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingProperty.json - */ - /** - * Sample code: UpdateBillingProperty. - * - * @param manager Entry point to BillingManager. - */ - public static void updateBillingProperty(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingProperties().updateWithResponse(new BillingPropertyInner().withCostCenter("1010"), Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountSamples.java deleted file mode 100644 index 0a966431f661..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleAssignments DeleteByBillingAccount. */ -public final class BillingRoleAssignmentsDeleteByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentDelete.json - */ - /** - * Sample code: BillingAccountRoleAssignmentDelete. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountRoleAssignmentDelete(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleAssignments() - .deleteByBillingAccountWithResponse("{billingAccountName}", "{billingRoleAssignmentName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileSamples.java deleted file mode 100644 index 63ea44963b55..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleAssignments DeleteByBillingProfile. */ -public final class BillingRoleAssignmentsDeleteByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentDelete.json - */ - /** - * Sample code: BillingProfileRoleAssignmentDelete. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfileRoleAssignmentDelete(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleAssignments() - .deleteByBillingProfileWithResponse( - "{billingAccountName}", "{billingProfileName}", "{billingRoleAssignmentName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionSamples.java deleted file mode 100644 index 11bfcfbbf34a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleAssignments DeleteByInvoiceSection. */ -public final class BillingRoleAssignmentsDeleteByInvoiceSectionSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentDelete.json - */ - /** - * Sample code: InvoiceSectionRoleAssignmentDelete. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceSectionRoleAssignmentDelete(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleAssignments() - .deleteByInvoiceSectionWithResponse( - "{billingAccountName}", - "{billingProfileName}", - "{invoiceSectionName}", - "{billingRoleAssignmentName}", - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountSamples.java deleted file mode 100644 index f5094b6a9c0b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleAssignments GetByBillingAccount. */ -public final class BillingRoleAssignmentsGetByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignment.json - */ - /** - * Sample code: BillingAccountRoleAssignment. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountRoleAssignment(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleAssignments() - .getByBillingAccountWithResponse("{billingAccountName}", "{billingRoleAssignmentId}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileSamples.java deleted file mode 100644 index a3d28d6ca575..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleAssignments GetByBillingProfile. */ -public final class BillingRoleAssignmentsGetByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignment.json - */ - /** - * Sample code: BillingProfileRoleAssignment. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfileRoleAssignment(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleAssignments() - .getByBillingProfileWithResponse( - "{billingAccountName}", "{billingProfileName}", "{billingRoleAssignmentName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionSamples.java deleted file mode 100644 index 6b0ba6d85c2e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleAssignments GetByInvoiceSection. */ -public final class BillingRoleAssignmentsGetByInvoiceSectionSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignment.json - */ - /** - * Sample code: InvoiceSectionRoleAssignment. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceSectionRoleAssignment(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleAssignments() - .getByInvoiceSectionWithResponse( - "{billingAccountName}", - "{billingProfileName}", - "{invoiceSectionName}", - "{billingRoleAssignmentName}", - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountSamples.java deleted file mode 100644 index 5f333d2a39c8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleAssignments ListByBillingAccount. */ -public final class BillingRoleAssignmentsListByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentList.json - */ - /** - * Sample code: BillingAccountRoleAssignmentList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountRoleAssignmentList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingRoleAssignments().listByBillingAccount("{billingAccountName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileSamples.java deleted file mode 100644 index 019616f24233..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleAssignments ListByBillingProfile. */ -public final class BillingRoleAssignmentsListByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentList.json - */ - /** - * Sample code: BillingProfileRoleAssignmentList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfileRoleAssignmentList(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleAssignments() - .listByBillingProfile("{billingAccountName}", "{billingProfileName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionSamples.java deleted file mode 100644 index 3d081b795d66..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleAssignments ListByInvoiceSection. */ -public final class BillingRoleAssignmentsListByInvoiceSectionSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentList.json - */ - /** - * Sample code: InvoiceSectionRoleAssignmentList. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceSectionRoleAssignmentList(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleAssignments() - .listByInvoiceSection("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountSamples.java deleted file mode 100644 index a16a3844e978..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleDefinitions GetByBillingAccount. */ -public final class BillingRoleDefinitionsGetByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinition.json - */ - /** - * Sample code: BillingAccountRoleDefinition. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountRoleDefinition(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleDefinitions() - .getByBillingAccountWithResponse("{billingAccountName}", "{billingRoleDefinitionName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileSamples.java deleted file mode 100644 index 10e9e17f0587..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleDefinitions GetByBillingProfile. */ -public final class BillingRoleDefinitionsGetByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinition.json - */ - /** - * Sample code: BillingProfileRoleDefinition. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfileRoleDefinition(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleDefinitions() - .getByBillingProfileWithResponse( - "{billingAccountName}", "{billingProfileName}", "{billingRoleDefinitionName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionSamples.java deleted file mode 100644 index 6c06ac21b249..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleDefinitions GetByInvoiceSection. */ -public final class BillingRoleDefinitionsGetByInvoiceSectionSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinition.json - */ - /** - * Sample code: InvoiceSectionRoleDefinition. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceSectionRoleDefinition(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleDefinitions() - .getByInvoiceSectionWithResponse( - "{billingAccountName}", - "{billingProfileName}", - "{invoiceSectionName}", - "{billingRoleDefinitionName}", - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountSamples.java deleted file mode 100644 index de40a8e780fe..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleDefinitions ListByBillingAccount. */ -public final class BillingRoleDefinitionsListByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinitionsList.json - */ - /** - * Sample code: BillingAccountRoleDefinitionsList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountRoleDefinitionsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingRoleDefinitions().listByBillingAccount("{billingAccountName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileSamples.java deleted file mode 100644 index c9ee5797c73d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleDefinitions ListByBillingProfile. */ -public final class BillingRoleDefinitionsListByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinitionsList.json - */ - /** - * Sample code: BillingProfileRoleDefinitionsList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfileRoleDefinitionsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleDefinitions() - .listByBillingProfile("{billingAccountName}", "{billingProfileName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionSamples.java deleted file mode 100644 index b3b6ebddf2c3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingRoleDefinitions ListByInvoiceSection. */ -public final class BillingRoleDefinitionsListByInvoiceSectionSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinitionsList.json - */ - /** - * Sample code: InvoiceSectionRoleDefinitionsList. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceSectionRoleDefinitionsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingRoleDefinitions() - .listByInvoiceSection("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetSamples.java deleted file mode 100644 index 5eaccf06b413..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingSubscriptions Get. */ -public final class BillingSubscriptionsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscription.json - */ - /** - * Sample code: BillingSubscription. - * - * @param manager Entry point to BillingManager. - */ - public static void billingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingSubscriptions().getWithResponse("{billingAccountName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountSamples.java deleted file mode 100644 index 58445b016ab3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingSubscriptions ListByBillingAccount. */ -public final class BillingSubscriptionsListByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingAccount.json - */ - /** - * Sample code: BillingSubscriptionsListByBillingAccount. - * - * @param manager Entry point to BillingManager. - */ - public static void billingSubscriptionsListByBillingAccount( - com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingSubscriptions().listByBillingAccount("{billingAccountName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileSamples.java deleted file mode 100644 index 7e331b4b0322..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingSubscriptions ListByBillingProfile. */ -public final class BillingSubscriptionsListByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingProfile.json - */ - /** - * Sample code: BillingSubscriptionsListByBillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void billingSubscriptionsListByBillingProfile( - com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingSubscriptions() - .listByBillingProfile("{billingAccountName}", "{billingProfileName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerSamples.java deleted file mode 100644 index 004491ae7251..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingSubscriptions ListByCustomer. */ -public final class BillingSubscriptionsListByCustomerSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByCustomer.json - */ - /** - * Sample code: BillingSubscriptionsListByCustomer. - * - * @param manager Entry point to BillingManager. - */ - public static void billingSubscriptionsListByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { - manager.billingSubscriptions().listByCustomer("{billingAccountName}", "{customerName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionSamples.java deleted file mode 100644 index 5d1822d5ac2d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for BillingSubscriptions ListByInvoiceSection. */ -public final class BillingSubscriptionsListByInvoiceSectionSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByInvoiceSection.json - */ - /** - * Sample code: BillingSubscriptionsListByInvoiceSection. - * - * @param manager Entry point to BillingManager. - */ - public static void billingSubscriptionsListByInvoiceSection( - com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingSubscriptions() - .listByInvoiceSection("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveSamples.java deleted file mode 100644 index d2b3d9749bbd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; - -/** Samples for BillingSubscriptions Move. */ -public final class BillingSubscriptionsMoveSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveBillingSubscription.json - */ - /** - * Sample code: MoveBillingSubscription. - * - * @param manager Entry point to BillingManager. - */ - public static void moveBillingSubscription(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingSubscriptions() - .move( - "{billingAccountName}", - new TransferBillingSubscriptionRequestProperties() - .withDestinationInvoiceSectionId( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateSamples.java deleted file mode 100644 index 4a0cec69d8cf..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; - -/** Samples for BillingSubscriptions Update. */ -public final class BillingSubscriptionsUpdateSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingSubscription.json - */ - /** - * Sample code: UpdateBillingProperty. - * - * @param manager Entry point to BillingManager. - */ - public static void updateBillingProperty(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingSubscriptions() - .updateWithResponse( - "{billingAccountName}", new BillingSubscriptionInner().withCostCenter("ABC1234"), Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsValidateMoveSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsValidateMoveSamples.java deleted file mode 100644 index 9a0c467b966b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsValidateMoveSamples.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; - -/** Samples for BillingSubscriptions ValidateMove. */ -public final class BillingSubscriptionsValidateMoveSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveFailure.json - */ - /** - * Sample code: SubscriptionMoveValidateFailure. - * - * @param manager Entry point to BillingManager. - */ - public static void subscriptionMoveValidateFailure(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingSubscriptions() - .validateMoveWithResponse( - "{billingAccountName}", - new TransferBillingSubscriptionRequestProperties() - .withDestinationInvoiceSectionId( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveSuccess.json - */ - /** - * Sample code: SubscriptionMoveValidateSuccess. - * - * @param manager Entry point to BillingManager. - */ - public static void subscriptionMoveValidateSuccess(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .billingSubscriptions() - .validateMoveWithResponse( - "{billingAccountName}", - new TransferBillingSubscriptionRequestProperties() - .withDestinationInvoiceSectionId( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersGetSamples.java deleted file mode 100644 index 22a64e041199..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersGetSamples.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Customers Get. */ -public final class CustomersGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerWithExpand.json - */ - /** - * Sample code: CustomerWithExpand. - * - * @param manager Entry point to BillingManager. - */ - public static void customerWithExpand(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .customers() - .getWithResponse("{billingAccountName}", "{customerName}", "enabledAzurePlans,resellers", Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Customer.json - */ - /** - * Sample code: Customer. - * - * @param manager Entry point to BillingManager. - */ - public static void customer(com.azure.resourcemanager.billing.BillingManager manager) { - manager.customers().getWithResponse("{billingAccountName}", "{customerName}", null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountSamples.java deleted file mode 100644 index 993974054cef..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Customers ListByBillingAccount. */ -public final class CustomersListByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingAccount.json - */ - /** - * Sample code: CustomersListByBillingAccount. - * - * @param manager Entry point to BillingManager. - */ - public static void customersListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { - manager.customers().listByBillingAccount("{billingAccountName}", null, null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileSamples.java deleted file mode 100644 index 207b9021ec42..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Customers ListByBillingProfile. */ -public final class CustomersListByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingProfile.json - */ - /** - * Sample code: CustomersListByBillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void customersListByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .customers() - .listByBillingProfile("{billingAccountName}", "{billingProfileName}", null, null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetSamples.java deleted file mode 100644 index 68876551c561..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for EnrollmentAccounts Get. */ -public final class EnrollmentAccountsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsGet.json - */ - /** - * Sample code: EnrollmentAccountsGet. - * - * @param manager Entry point to BillingManager. - */ - public static void enrollmentAccountsGet(com.azure.resourcemanager.billing.BillingManager manager) { - manager.enrollmentAccounts().getWithResponse("e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListSamples.java deleted file mode 100644 index 9606d8c3c070..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for EnrollmentAccounts List. */ -public final class EnrollmentAccountsListSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsList.json - */ - /** - * Sample code: EnrollmentAccountsList. - * - * @param manager Entry point to BillingManager. - */ - public static void enrollmentAccountsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.enrollmentAccounts().list(Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsGetSamples.java deleted file mode 100644 index d7828ea026d7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsGetSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Instructions Get. */ -public final class InstructionsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Instruction.json - */ - /** - * Sample code: Instruction. - * - * @param manager Entry point to BillingManager. - */ - public static void instruction(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .instructions() - .getWithResponse("{billingAccountName}", "{billingProfileName}", "{instructionName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileSamples.java deleted file mode 100644 index 88dcec0dd184..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Instructions ListByBillingProfile. */ -public final class InstructionsListByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InstructionsListByBillingProfile.json - */ - /** - * Sample code: InstructionsListByBillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void instructionsListByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { - manager.instructions().listByBillingProfile("{billingAccountName}", "{billingProfileName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsPutSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsPutSamples.java deleted file mode 100644 index e745347806c7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsPutSamples.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import java.time.OffsetDateTime; - -/** Samples for Instructions Put. */ -public final class InstructionsPutSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInstruction.json - */ - /** - * Sample code: PutInstruction. - * - * @param manager Entry point to BillingManager. - */ - public static void putInstruction(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .instructions() - .putWithResponse( - "{billingAccountName}", - "{billingProfileName}", - "{instructionName}", - new InstructionInner() - .withAmount(5000f) - .withStartDate(OffsetDateTime.parse("2019-12-30T21:26:47.997Z")) - .withEndDate(OffsetDateTime.parse("2020-12-30T21:26:47.997Z")), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java deleted file mode 100644 index 63690c7a725d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import java.util.HashMap; -import java.util.Map; - -/** Samples for InvoiceSections CreateOrUpdate. */ -public final class InvoiceSectionsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInvoiceSection.json - */ - /** - * Sample code: PutInvoiceSection. - * - * @param manager Entry point to BillingManager. - */ - public static void putInvoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .invoiceSections() - .createOrUpdate( - "{billingAccountName}", - "{billingProfileName}", - "{invoiceSectionName}", - new InvoiceSectionInner() - .withDisplayName("invoiceSection1") - .withLabels(mapOf("costCategory", "Support", "pcCode", "A123456")), - Context.NONE); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetSamples.java deleted file mode 100644 index c6ef09db5d0d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for InvoiceSections Get. */ -public final class InvoiceSectionsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSection.json - */ - /** - * Sample code: InvoiceSection. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .invoiceSections() - .getWithResponse("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileSamples.java deleted file mode 100644 index fea4d59800b9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for InvoiceSections ListByBillingProfile. */ -public final class InvoiceSectionsListByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListByBillingProfile.json - */ - /** - * Sample code: InvoiceSectionsListByBillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceSectionsListByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoiceSections().listByBillingProfile("{billingAccountName}", "{billingProfileName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceSamples.java deleted file mode 100644 index 6e2df99ca8f8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Invoices DownloadBillingSubscriptionInvoice. */ -public final class InvoicesDownloadBillingSubscriptionInvoiceSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoiceDownload.json - */ - /** - * Sample code: BillingSubscriptionInvoiceDownload. - * - * @param manager Entry point to BillingManager. - */ - public static void billingSubscriptionInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().downloadBillingSubscriptionInvoice("{invoiceName}", "DRS_12345", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceSamples.java deleted file mode 100644 index f784e90b1027..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Invoices DownloadInvoice. */ -public final class InvoicesDownloadInvoiceSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json - */ - /** - * Sample code: InvoiceDownload. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().downloadInvoice("{billingAccountName}", "{invoiceName}", "DRS_12345", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesSamples.java deleted file mode 100644 index 6ef29dbe48cc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesSamples.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import java.util.Arrays; - -/** Samples for Invoices DownloadMultipleBillingProfileInvoices. */ -public final class InvoicesDownloadMultipleBillingProfileInvoicesSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json - */ - /** - * Sample code: BillingProfileInvoiceDownload. - * - * @param manager Entry point to BillingManager. - */ - public static void billingProfileInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .invoices() - .downloadMultipleBillingProfileInvoices( - "{billingAccountName}", - Arrays - .asList( - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples.java deleted file mode 100644 index 85a83d579782..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import java.util.Arrays; - -/** Samples for Invoices DownloadMultipleBillingSubscriptionInvoices. */ -public final class InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json - */ - /** - * Sample code: BillingSubscriptionInvoiceDownload. - * - * @param manager Entry point to BillingManager. - */ - public static void billingSubscriptionInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .invoices() - .downloadMultipleBillingSubscriptionInvoices( - Arrays - .asList( - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01", - "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdSamples.java deleted file mode 100644 index b25a8567efde..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Invoices GetById. */ -public final class InvoicesGetByIdSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceById.json - */ - /** - * Sample code: Invoice. - * - * @param manager Entry point to BillingManager. - */ - public static void invoice(com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().getByIdWithResponse("{invoiceName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdSamples.java deleted file mode 100644 index 331e45ad686d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Invoices GetBySubscriptionAndInvoiceId. */ -public final class InvoicesGetBySubscriptionAndInvoiceIdSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoice.json - */ - /** - * Sample code: BillingSubscriptionsListByBillingAccount. - * - * @param manager Entry point to BillingManager. - */ - public static void billingSubscriptionsListByBillingAccount( - com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().getBySubscriptionAndInvoiceIdWithResponse("{invoiceName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetSamples.java deleted file mode 100644 index 02b1724a781e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetSamples.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Invoices Get. */ -public final class InvoicesGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Invoice.json - */ - /** - * Sample code: Invoice. - * - * @param manager Entry point to BillingManager. - */ - public static void invoice(com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CreditNote.json - */ - /** - * Sample code: CreditNote. - * - * @param manager Entry point to BillingManager. - */ - public static void creditNote(com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/VoidInvoice.json - */ - /** - * Sample code: VoidInvoice. - * - * @param manager Entry point to BillingManager. - */ - public static void voidInvoice(com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceWithRebillDetails.json - */ - /** - * Sample code: InvoiceWithRebillDetails. - * - * @param manager Entry point to BillingManager. - */ - public static void invoiceWithRebillDetails(com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().getWithResponse("{billingAccountName}", "{invoiceName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountSamples.java deleted file mode 100644 index 7644a71b5504..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountSamples.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Invoices ListByBillingAccount. */ -public final class InvoicesListByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesList.json - */ - /** - * Sample code: BillingAccountInvoicesList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountInvoicesList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().listByBillingAccount("{billingAccountName}", "2018-01-01", "2018-06-30", Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesListWithRebillDetails.json - */ - /** - * Sample code: BillingAccountInvoicesListWithRebillDetails. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountInvoicesListWithRebillDetails( - com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().listByBillingAccount("{billingAccountName}", "2018-01-01", "2018-06-30", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileSamples.java deleted file mode 100644 index 4ee6ff91d7b0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileSamples.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Invoices ListByBillingProfile. */ -public final class InvoicesListByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfile.json - */ - /** - * Sample code: InvoicesListByBillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void invoicesListByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .invoices() - .listByBillingProfile( - "{billingAccountName}", "{billingProfileName}", "2018-01-01", "2018-06-30", Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfileWithRebillDetails.json - */ - /** - * Sample code: InvoicesListByBillingProfileWithRebillDetails. - * - * @param manager Entry point to BillingManager. - */ - public static void invoicesListByBillingProfileWithRebillDetails( - com.azure.resourcemanager.billing.BillingManager manager) { - manager - .invoices() - .listByBillingProfile( - "{billingAccountName}", "{billingProfileName}", "2018-01-01", "2018-06-30", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionSamples.java deleted file mode 100644 index d869b694d110..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Invoices ListByBillingSubscription. */ -public final class InvoicesListByBillingSubscriptionSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoicesList.json - */ - /** - * Sample code: BillingSubscriptionsListByBillingAccount. - * - * @param manager Entry point to BillingManager. - */ - public static void billingSubscriptionsListByBillingAccount( - com.azure.resourcemanager.billing.BillingManager manager) { - manager.invoices().listByBillingSubscription("2018-01-01", "2018-06-30", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileSamples.java deleted file mode 100644 index 221e5e74a4aa..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Policies GetByBillingProfile. */ -public final class PoliciesGetByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Policy.json - */ - /** - * Sample code: PolicyByBillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void policyByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .policies() - .getByBillingProfileWithResponse("{billingAccountName}", "{billingProfileName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerSamples.java deleted file mode 100644 index a8bca455e16b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Policies GetByCustomer. */ -public final class PoliciesGetByCustomerSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPolicy.json - */ - /** - * Sample code: PolicyByCustomer. - * - * @param manager Entry point to BillingManager. - */ - public static void policyByCustomer(com.azure.resourcemanager.billing.BillingManager manager) { - manager.policies().getByCustomerWithResponse("{billingAccountName}", "{customerName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerSamples.java deleted file mode 100644 index 538a0cff6244..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.models.ViewCharges; - -/** Samples for Policies UpdateCustomer. */ -public final class PoliciesUpdateCustomerSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateCustomerPolicy.json - */ - /** - * Sample code: UpdateCustomer. - * - * @param manager Entry point to BillingManager. - */ - public static void updateCustomer(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .policies() - .updateCustomerWithResponse( - "{billingAccountName}", - "{customerName}", - new CustomerPolicyInner().withViewCharges(ViewCharges.NOT_ALLOWED), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateSamples.java deleted file mode 100644 index e6ccf5414fe3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateSamples.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; - -/** Samples for Policies Update. */ -public final class PoliciesUpdateSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdatePolicy.json - */ - /** - * Sample code: UpdatePolicy. - * - * @param manager Entry point to BillingManager. - */ - public static void updatePolicy(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .policies() - .updateWithResponse( - "{billingAccountName}", - "{billingProfileName}", - new PolicyInner() - .withMarketplacePurchases(MarketplacePurchasesPolicy.ONLY_FREE_ALLOWED) - .withReservationPurchases(ReservationPurchasesPolicy.NOT_ALLOWED) - .withViewCharges(ViewChargesPolicy.ALLOWED), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsGetSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsGetSamples.java deleted file mode 100644 index bd47a481ee4f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Products Get. */ -public final class ProductsGetSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Product.json - */ - /** - * Sample code: Product. - * - * @param manager Entry point to BillingManager. - */ - public static void product(com.azure.resourcemanager.billing.BillingManager manager) { - manager.products().getWithResponse("{billingAccountName}", "{productName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountSamples.java deleted file mode 100644 index 97b07ceb2eef..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Products ListByBillingAccount. */ -public final class ProductsListByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingAccount.json - */ - /** - * Sample code: ProductsListByBillingAccount. - * - * @param manager Entry point to BillingManager. - */ - public static void productsListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { - manager.products().listByBillingAccount("{billingAccountName}", null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileSamples.java deleted file mode 100644 index 564c6d7e6114..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Products ListByBillingProfile. */ -public final class ProductsListByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingProfile.json - */ - /** - * Sample code: ProductsListByBillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void productsListByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { - manager.products().listByBillingProfile("{billingAccountName}", "{billingProfileName}", null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerSamples.java deleted file mode 100644 index 1cdd539f1692..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Products ListByCustomer. */ -public final class ProductsListByCustomerSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByCustomer.json - */ - /** - * Sample code: ProductsListByInvoiceSection. - * - * @param manager Entry point to BillingManager. - */ - public static void productsListByInvoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { - manager.products().listByCustomer("{billingAccountName}", "{customerName}", Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionSamples.java deleted file mode 100644 index ec2bbef78f94..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Products ListByInvoiceSection. */ -public final class ProductsListByInvoiceSectionSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByInvoiceSection.json - */ - /** - * Sample code: ProductsListByInvoiceSection. - * - * @param manager Entry point to BillingManager. - */ - public static void productsListByInvoiceSection(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .products() - .listByInvoiceSection( - "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", null, Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsMoveSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsMoveSamples.java deleted file mode 100644 index 618b8dd8edb0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsMoveSamples.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.models.TransferProductRequestProperties; - -/** Samples for Products Move. */ -public final class ProductsMoveSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveProduct.json - */ - /** - * Sample code: MoveProduct. - * - * @param manager Entry point to BillingManager. - */ - public static void moveProduct(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .products() - .moveWithResponse( - "{billingAccountName}", - "{productName}", - new TransferProductRequestProperties() - .withDestinationInvoiceSectionId( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsUpdateSamples.java deleted file mode 100644 index bdbc6dcc3da4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsUpdateSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.azure.resourcemanager.billing.models.AutoRenew; - -/** Samples for Products Update. */ -public final class ProductsUpdateSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateProduct.json - */ - /** - * Sample code: UpdateBillingProperty. - * - * @param manager Entry point to BillingManager. - */ - public static void updateBillingProperty(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .products() - .updateWithResponse( - "{billingAccountName}", "{productName}", new ProductInner().withAutoRenew(AutoRenew.OFF), Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsValidateMoveSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsValidateMoveSamples.java deleted file mode 100644 index d903fa692456..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsValidateMoveSamples.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.billing.models.TransferProductRequestProperties; - -/** Samples for Products ValidateMove. */ -public final class ProductsValidateMoveSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveFailure.json - */ - /** - * Sample code: SubscriptionMoveValidateFailure. - * - * @param manager Entry point to BillingManager. - */ - public static void subscriptionMoveValidateFailure(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .products() - .validateMoveWithResponse( - "{billingAccountName}", - "{productName}", - new TransferProductRequestProperties() - .withDestinationInvoiceSectionId( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - Context.NONE); - } - - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveSuccess.json - */ - /** - * Sample code: SubscriptionMoveValidateSuccess. - * - * @param manager Entry point to BillingManager. - */ - public static void subscriptionMoveValidateSuccess(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .products() - .validateMoveWithResponse( - "{billingAccountName}", - "{productName}", - new TransferProductRequestProperties() - .withDestinationInvoiceSectionId( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountSamples.java deleted file mode 100644 index 8ba0e0f25cbc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Reservations ListByBillingAccount. */ -public final class ReservationsListByBillingAccountSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingAccount.json - */ - /** - * Sample code: ReservationsListByBillingAccount. - * - * @param manager Entry point to BillingManager. - */ - public static void reservationsListByBillingAccount(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .reservations() - .listByBillingAccount( - "{billingAccountName}", - "properties/reservedResourceType eq 'VirtualMachines'", - "properties/userFriendlyAppliedScopeType asc", - "true", - "Succeeded", - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileSamples.java deleted file mode 100644 index a2e765a0d1c6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileSamples.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Reservations ListByBillingProfile. */ -public final class ReservationsListByBillingProfileSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingProfile.json - */ - /** - * Sample code: ReservationsListByBillingProfile. - * - * @param manager Entry point to BillingManager. - */ - public static void reservationsListByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) { - manager - .reservations() - .listByBillingProfile( - "{billingAccountName}", - "{billingProfileName}", - "properties/reservedResourceType eq 'VirtualMachines'", - "properties/userFriendlyAppliedScopeType asc", - "true", - "Succeeded", - Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceSamples.java deleted file mode 100644 index 9daee92899ec..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.Context; - -/** Samples for Transactions ListByInvoice. */ -public final class TransactionsListByInvoiceSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/TransactionsListByInvoice.json - */ - /** - * Sample code: TransactionsListByInvoice. - * - * @param manager Entry point to BillingManager. - */ - public static void transactionsListByInvoice(com.azure.resourcemanager.billing.BillingManager manager) { - manager.transactions().listByInvoice("{billingAccountName}", "{invoiceName}", Context.NONE); - } -}