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 759e6a82c9cf..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java +++ /dev/null @@ -1,604 +0,0 @@ -// Copyright (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.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -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.RetryOptions; -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; -import java.util.stream.Collectors; - -/** 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 BillingRoleDefinitions billingRoleDefinitions; - - private BillingRoleAssignments billingRoleAssignments; - - private Agreements agreements; - - private Reservations reservations; - - private EnrollmentAccounts enrollmentAccounts; - - private BillingPeriods billingPeriods; - - private Operations operations; - - 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); - } - - /** - * Creates an instance of Billing service API entry point. - * - * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. - * @param profile the Azure profile for client. - * @return the Billing service API instance. - */ - public static BillingManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new BillingManager(httpPipeline, profile, null); - } - - /** - * 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 static 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 RetryOptions retryOptions; - 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 retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. - * - * @param retryOptions the retry options for the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryOptions(RetryOptions retryOptions) { - this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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, "'defaultPollInterval' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' 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.3"); - 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) { - if (retryOptions != null) { - retryPolicy = new RetryPolicy(retryOptions); - } else { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new AddHeadersFromContextPolicy()); - policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - 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); - } - } - - /** - * Gets the resource collection API of BillingAccounts. - * - * @return Resource collection API of BillingAccounts. - */ - public BillingAccounts billingAccounts() { - if (this.billingAccounts == null) { - this.billingAccounts = new BillingAccountsImpl(clientObject.getBillingAccounts(), this); - } - return billingAccounts; - } - - /** - * Gets the resource collection API of Address. - * - * @return Resource collection API of Address. - */ - public Address address() { - if (this.address == null) { - this.address = new AddressImpl(clientObject.getAddress(), this); - } - return address; - } - - /** - * Gets the resource collection API of AvailableBalances. - * - * @return Resource collection API of AvailableBalances. - */ - public AvailableBalances availableBalances() { - if (this.availableBalances == null) { - this.availableBalances = new AvailableBalancesImpl(clientObject.getAvailableBalances(), this); - } - return availableBalances; - } - - /** - * Gets the resource collection API of Instructions. - * - * @return Resource collection API of Instructions. - */ - public Instructions instructions() { - if (this.instructions == null) { - this.instructions = new InstructionsImpl(clientObject.getInstructions(), this); - } - return instructions; - } - - /** - * Gets the resource collection API of BillingProfiles. - * - * @return Resource collection API of BillingProfiles. - */ - public BillingProfiles billingProfiles() { - if (this.billingProfiles == null) { - this.billingProfiles = new BillingProfilesImpl(clientObject.getBillingProfiles(), this); - } - return billingProfiles; - } - - /** - * Gets the resource collection API of Customers. - * - * @return Resource collection API of Customers. - */ - public Customers customers() { - if (this.customers == null) { - this.customers = new CustomersImpl(clientObject.getCustomers(), this); - } - return customers; - } - - /** - * Gets the resource collection API of InvoiceSections. - * - * @return Resource collection API of InvoiceSections. - */ - public InvoiceSections invoiceSections() { - if (this.invoiceSections == null) { - this.invoiceSections = new InvoiceSectionsImpl(clientObject.getInvoiceSections(), this); - } - return invoiceSections; - } - - /** - * Gets the resource collection API of BillingPermissions. - * - * @return Resource collection API of BillingPermissions. - */ - public BillingPermissions billingPermissions() { - if (this.billingPermissions == null) { - this.billingPermissions = new BillingPermissionsImpl(clientObject.getBillingPermissions(), this); - } - return billingPermissions; - } - - /** - * Gets the resource collection API of BillingSubscriptions. - * - * @return Resource collection API of BillingSubscriptions. - */ - public BillingSubscriptions billingSubscriptions() { - if (this.billingSubscriptions == null) { - this.billingSubscriptions = new BillingSubscriptionsImpl(clientObject.getBillingSubscriptions(), this); - } - return billingSubscriptions; - } - - /** - * Gets the resource collection API of Products. - * - * @return Resource collection API of Products. - */ - public Products products() { - if (this.products == null) { - this.products = new ProductsImpl(clientObject.getProducts(), this); - } - return products; - } - - /** - * Gets the resource collection API of Invoices. - * - * @return Resource collection API of Invoices. - */ - public Invoices invoices() { - if (this.invoices == null) { - this.invoices = new InvoicesImpl(clientObject.getInvoices(), this); - } - return invoices; - } - - /** - * Gets the resource collection API of Transactions. - * - * @return Resource collection API of Transactions. - */ - public Transactions transactions() { - if (this.transactions == null) { - this.transactions = new TransactionsImpl(clientObject.getTransactions(), this); - } - return transactions; - } - - /** - * Gets the resource collection API of Policies. - * - * @return Resource collection API of Policies. - */ - public Policies policies() { - if (this.policies == null) { - this.policies = new PoliciesImpl(clientObject.getPolicies(), this); - } - return policies; - } - - /** - * Gets the resource collection API of BillingProperties. - * - * @return Resource collection API of BillingProperties. - */ - public BillingProperties billingProperties() { - if (this.billingProperties == null) { - this.billingProperties = new BillingPropertiesImpl(clientObject.getBillingProperties(), this); - } - return billingProperties; - } - - /** - * Gets the resource collection API of BillingRoleDefinitions. - * - * @return Resource collection API of BillingRoleDefinitions. - */ - public BillingRoleDefinitions billingRoleDefinitions() { - if (this.billingRoleDefinitions == null) { - this.billingRoleDefinitions = - new BillingRoleDefinitionsImpl(clientObject.getBillingRoleDefinitions(), this); - } - return billingRoleDefinitions; - } - - /** - * Gets the resource collection API of BillingRoleAssignments. - * - * @return Resource collection API of BillingRoleAssignments. - */ - public BillingRoleAssignments billingRoleAssignments() { - if (this.billingRoleAssignments == null) { - this.billingRoleAssignments = - new BillingRoleAssignmentsImpl(clientObject.getBillingRoleAssignments(), this); - } - return billingRoleAssignments; - } - - /** - * Gets the resource collection API of Agreements. - * - * @return Resource collection API of Agreements. - */ - public Agreements agreements() { - if (this.agreements == null) { - this.agreements = new AgreementsImpl(clientObject.getAgreements(), this); - } - return agreements; - } - - /** - * Gets the resource collection API of Reservations. - * - * @return Resource collection API of Reservations. - */ - public Reservations reservations() { - if (this.reservations == null) { - this.reservations = new ReservationsImpl(clientObject.getReservations(), this); - } - return reservations; - } - - /** - * Gets the resource collection API of EnrollmentAccounts. - * - * @return Resource collection API of EnrollmentAccounts. - */ - public EnrollmentAccounts enrollmentAccounts() { - if (this.enrollmentAccounts == null) { - this.enrollmentAccounts = new EnrollmentAccountsImpl(clientObject.getEnrollmentAccounts(), this); - } - return enrollmentAccounts; - } - - /** - * Gets the resource collection API of BillingPeriods. - * - * @return Resource collection API of BillingPeriods. - */ - public BillingPeriods billingPeriods() { - if (this.billingPeriods == null) { - this.billingPeriods = new BillingPeriodsImpl(clientObject.getBillingPeriods(), this); - } - return billingPeriods; - } - - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * @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 3810e247e2ee..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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse(AddressDetails address, 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 com.azure.core.management.exception.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); -} 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 2966384ab22a..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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String agreementName, 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); -} 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 338e89332f7d..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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String billingProfileName, 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 com.azure.core.management.exception.ManagementException 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); -} 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 7dd1f15292b7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingAccountsClient.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingAccountName, 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); - - /** - * 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 as paginated response with - * {@link PagedIterable}. - */ - @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 as paginated response with - * {@link PagedIterable}. - */ - @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 3f98daa9f4f3..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 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(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); -} 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 29b0f172ec4b..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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingPeriodName, 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); -} 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 0cad08a5895b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/BillingPermissionsClient.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.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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 ad55bc8a2616..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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String billingProfileName, 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); - - /** - * 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 70dcb91077fe..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. - * - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(Context context); - - /** - * 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(); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(BillingPropertyInner parameters, 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); -} 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 52f89a0a81f6..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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, 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 com.azure.core.management.exception.ManagementException 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByBillingAccountWithResponse( - 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByInvoiceSectionWithResponse( - 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByBillingProfileWithResponse( - 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); - - /** - * 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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 6d961616bd0d..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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleDefinitionName, 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 com.azure.core.management.exception.ManagementException 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 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - 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 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, 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); - - /** - * 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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 6eb1ae8e6cc4..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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingAccountName, 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, 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); - - /** - * 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateMoveWithResponse( - 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); -} 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 df99217822ca..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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String customerName, String expand, 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); -} 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 85926cd3b8cb..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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String name, 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); -} 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 a1217295a863..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InstructionsClient.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; - -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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String billingProfileName, String instructionName, 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse( - String billingAccountName, - String billingProfileName, - String instructionName, - InstructionInner parameters, - 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); -} 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 a493fb296877..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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String billingAccountName, String billingProfileName, String invoiceSectionName, 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); - - /** - * 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 5cff0be560ef..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/InvoicesClient.java +++ /dev/null @@ -1,442 +0,0 @@ -// Copyright (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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingAccountName, String invoiceName, 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 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByIdWithResponse(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 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, 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 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 67a5aaa856f6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/OperationsClient.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.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 as paginated response with - * {@link PagedIterable}. - */ - @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 as paginated response with - * {@link PagedIterable}. - */ - @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 970ca0dadc0f..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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, 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 com.azure.core.management.exception.ManagementException 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String billingAccountName, String billingProfileName, PolicyInner parameters, 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByCustomerWithResponse( - String billingAccountName, String customerName, 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateCustomerWithResponse( - String billingAccountName, String customerName, CustomerPolicyInner parameters, 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); -} 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 65148493ed64..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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingAccountName, String productName, 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String billingAccountName, String productName, ProductInner parameters, 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); - - /** - * 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); - - /** - * 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); - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateMoveWithResponse( - 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); -} 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 c6c8707457dd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/ReservationsClient.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (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 as paginated - * response with {@link PagedIterable}. - */ - @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 as paginated - * response with {@link PagedIterable}. - */ - @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 as paginated - * response with {@link PagedIterable}. - */ - @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 as paginated - * response with {@link PagedIterable}. - */ - @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 4e9e736b92e8..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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 9c5337fc4a92..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementInner.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.resourcemanager.billing.models.AcceptanceMode; -import com.azure.resourcemanager.billing.models.BillingProfileInfo; -import com.azure.resourcemanager.billing.models.Category; -import com.azure.resourcemanager.billing.models.Participants; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** An agreement. */ -@Fluent -public final class AgreementInner extends ProxyResource { - /* - * The properties of an agreement. - */ - @JsonProperty(value = "properties") - private AgreementProperties innerProperties; - - /** Creates an instance of AgreementInner class. */ - public AgreementInner() { - } - - /** - * 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 billingProfileInfo property: The list of billing profiles associated with agreement and present only for - * specific agreements. - * - * @return the billingProfileInfo value. - */ - public BillingProfileInfo billingProfileInfo() { - return this.innerProperties() == null ? null : this.innerProperties().billingProfileInfo(); - } - - /** - * 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 4b7f36d5a52d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/AgreementProperties.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (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.resourcemanager.billing.models.AcceptanceMode; -import com.azure.resourcemanager.billing.models.BillingProfileInfo; -import com.azure.resourcemanager.billing.models.Category; -import com.azure.resourcemanager.billing.models.Participants; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The properties of an agreement. */ -@Fluent -public final class AgreementProperties { - /* - * 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 list of billing profiles associated with agreement and present only for specific agreements. - */ - @JsonProperty(value = "billingProfileInfo", access = JsonProperty.Access.WRITE_ONLY) - private BillingProfileInfo billingProfileInfo; - - /* - * 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; - - /** Creates an instance of AgreementProperties class. */ - public AgreementProperties() { - } - - /** - * 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 billingProfileInfo property: The list of billing profiles associated with agreement and present only for - * specific agreements. - * - * @return the billingProfileInfo value. - */ - public BillingProfileInfo billingProfileInfo() { - return this.billingProfileInfo; - } - - /** - * 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 (billingProfileInfo() != null) { - billingProfileInfo().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 9347e9d2c5a5..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.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.billing.models.Amount; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The latest Azure credit balance. This is the balance available for pay now. */ -@Immutable -public final class AvailableBalanceInner extends ProxyResource { - /* - * The properties of available balance. - */ - @JsonProperty(value = "properties") - private AvailableBalanceProperties innerProperties; - - /** Creates an instance of AvailableBalanceInner class. */ - public AvailableBalanceInner() { - } - - /** - * 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 f0aeddeccacd..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.resourcemanager.billing.models.Amount; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of available balance. */ -@Immutable -public final class AvailableBalanceProperties { - /* - * Balance amount. - */ - @JsonProperty(value = "amount", access = JsonProperty.Access.WRITE_ONLY) - private Amount amount; - - /** Creates an instance of AvailableBalanceProperties class. */ - public AvailableBalanceProperties() { - } - - /** - * 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 9286c56cddee..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.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.JsonProperty; -import java.util.List; - -/** A billing account. */ -@Fluent -public final class BillingAccountInner extends ProxyResource { - /* - * The properties of the billing account. - */ - @JsonProperty(value = "properties") - private BillingAccountProperties innerProperties; - - /** Creates an instance of BillingAccountInner class. */ - public BillingAccountInner() { - } - - /** - * 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 22015daa5cb4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingAccountProperties.java +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (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.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.JsonProperty; -import java.util.List; - -/** The properties of the billing account. */ -@Fluent -public final class BillingAccountProperties { - /* - * 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; - - /** Creates an instance of BillingAccountProperties class. */ - public BillingAccountProperties() { - } - - /** - * 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 b1b0fc91723a..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.Immutable; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.LocalDate; -import java.util.List; - -/** A billing period resource. */ -@Immutable -public final class BillingPeriodInner extends ProxyResource { - /* - * A billing period. - */ - @JsonProperty(value = "properties") - private BillingPeriodProperties innerProperties; - - /** Creates an instance of BillingPeriodInner class. */ - public BillingPeriodInner() { - } - - /** - * 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 01f2338ac0aa..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.fasterxml.jackson.annotation.JsonProperty; -import java.time.LocalDate; -import java.util.List; - -/** The properties of the billing period. */ -@Immutable -public final class BillingPeriodProperties { - /* - * 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; - - /** Creates an instance of BillingPeriodProperties class. */ - public BillingPeriodProperties() { - } - - /** - * 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 ab1defbdb6f1..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.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 { - /* - * 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; - - /** Creates an instance of BillingPermissionsPropertiesInner class. */ - public BillingPermissionsPropertiesInner() { - } - - /** - * 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 fb7c22f890d4..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.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.JsonProperty; -import java.util.List; -import java.util.Map; - -/** A billing profile. */ -@Fluent -public final class BillingProfileInner extends ProxyResource { - /* - * The properties of the billing profile. - */ - @JsonProperty(value = "properties") - private BillingProfileProperties innerProperties; - - /** Creates an instance of BillingProfileInner class. */ - public BillingProfileInner() { - } - - /** - * 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 469a85db194b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingProfileProperties.java +++ /dev/null @@ -1,392 +0,0 @@ -// Copyright (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.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.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 { - /* - * 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; - - /** Creates an instance of BillingProfileProperties class. */ - public BillingProfileProperties() { - } - - /** - * 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 13b625a522e7..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.resourcemanager.billing.models.BillingProfileSpendingLimit; -import com.azure.resourcemanager.billing.models.BillingProfileStatus; -import com.azure.resourcemanager.billing.models.BillingProfileStatusReasonCode; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A billing property. */ -@Fluent -public final class BillingPropertyInner extends ProxyResource { - /* - * A billing property. - */ - @JsonProperty(value = "properties") - private BillingPropertyProperties innerProperties; - - /** Creates an instance of BillingPropertyInner class. */ - public BillingPropertyInner() { - } - - /** - * 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 25c4e7f9ec6c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingPropertyProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -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.JsonProperty; - -/** The billing property. */ -@Fluent -public final class BillingPropertyProperties { - /* - * 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; - - /** Creates an instance of BillingPropertyProperties class. */ - public BillingPropertyProperties() { - } - - /** - * 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 204fdab2a713..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.fasterxml.jackson.annotation.JsonProperty; - -/** The role assignment. */ -@Fluent -public final class BillingRoleAssignmentInner extends ProxyResource { - /* - * The properties of the role assignment. - */ - @JsonProperty(value = "properties") - private BillingRoleAssignmentProperties innerProperties; - - /** Creates an instance of BillingRoleAssignmentInner class. */ - public BillingRoleAssignmentInner() { - } - - /** - * 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 61a73807dfe0..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.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of the role assignment. */ -@Fluent -public final class BillingRoleAssignmentProperties { - /* - * 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; - - /** Creates an instance of BillingRoleAssignmentProperties class. */ - public BillingRoleAssignmentProperties() { - } - - /** - * 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 eff6d305c481..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.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of a role definition. */ -@Fluent -public final class BillingRoleDefinitionInner extends ProxyResource { - /* - * The properties of the a role definition. - */ - @JsonProperty(value = "properties") - private BillingRoleDefinitionProperties innerProperties; - - /** Creates an instance of BillingRoleDefinitionInner class. */ - public BillingRoleDefinitionInner() { - } - - /** - * 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 682de12736c2..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.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of the a role definition. */ -@Fluent -public final class BillingRoleDefinitionProperties { - /* - * 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; - - /** Creates an instance of BillingRoleDefinitionProperties class. */ - public BillingRoleDefinitionProperties() { - } - - /** - * 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 4fe6d32aa0f6..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.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import com.azure.resourcemanager.billing.models.Reseller; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.UUID; - -/** A billing subscription. */ -@Fluent -public final class BillingSubscriptionInner extends ProxyResource { - /* - * The billing properties of a subscription. - */ - @JsonProperty(value = "properties") - private BillingSubscriptionProperties innerProperties; - - /** Creates an instance of BillingSubscriptionInner class. */ - public BillingSubscriptionInner() { - } - - /** - * 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 790abdfb933a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/BillingSubscriptionProperties.java +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (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.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import com.azure.resourcemanager.billing.models.Reseller; -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 { - /* - * 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; - - /** Creates an instance of BillingSubscriptionProperties class. */ - public BillingSubscriptionProperties() { - } - - /** - * 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 5e6b0215c6ff..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.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Reseller; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A partner's customer. */ -@Fluent -public final class CustomerInner extends ProxyResource { - /* - * The customer. - */ - @JsonProperty(value = "properties") - private CustomerProperties innerProperties; - - /** Creates an instance of CustomerInner class. */ - public CustomerInner() { - } - - /** - * 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 4c61d6545364..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.resourcemanager.billing.models.ViewCharges; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The customer's Policy. */ -@Fluent -public final class CustomerPolicyInner extends ProxyResource { - /* - * The properties of a customer's policy. - */ - @JsonProperty(value = "properties") - private CustomerPolicyProperties innerProperties; - - /** Creates an instance of CustomerPolicyInner class. */ - public CustomerPolicyInner() { - } - - /** - * 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 5ee7699185b8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerPolicyProperties.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.resourcemanager.billing.models.ViewCharges; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a customer's policy. */ -@Fluent -public final class CustomerPolicyProperties { - /* - * 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; - - /** Creates an instance of CustomerPolicyProperties class. */ - public CustomerPolicyProperties() { - } - - /** - * 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 e6061bfd4a74..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/CustomerProperties.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (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.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Reseller; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of a customer. */ -@Fluent -public final class CustomerProperties { - /* - * 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; - - /** Creates an instance of CustomerProperties class. */ - public CustomerProperties() { - } - - /** - * 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 6f63be9b9ef0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/DepartmentProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The properties of a department. */ -@Fluent -public final class DepartmentProperties { - /* - * 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; - - /** Creates an instance of DepartmentProperties class. */ - public DepartmentProperties() { - } - - /** - * 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 a849996ba0bd..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.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 { - /* - * 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; - - /** Creates an instance of DownloadUrlInner class. */ - public DownloadUrlInner() { - } - - /** - * 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 7a73dd359bfd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/EnrollmentAccountProperties.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (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.resourcemanager.billing.models.Department; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of an enrollment account. */ -@Fluent -public final class EnrollmentAccountProperties { - /* - * 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; - - /** Creates an instance of EnrollmentAccountProperties class. */ - public EnrollmentAccountProperties() { - } - - /** - * 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 39de9f591389..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.Immutable; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** An enrollment account resource. */ -@Immutable -public final class EnrollmentAccountSummaryInner extends ProxyResource { - /* - * An enrollment account. - */ - @JsonProperty(value = "properties") - private EnrollmentAccountSummaryProperties innerProperties; - - /** Creates an instance of EnrollmentAccountSummaryInner class. */ - public EnrollmentAccountSummaryInner() { - } - - /** - * 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 b844a8e68cb5..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.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of the enrollment account. */ -@Immutable -public final class EnrollmentAccountSummaryProperties { - /* - * The account owner's principal name. - */ - @JsonProperty(value = "principalName", access = JsonProperty.Access.WRITE_ONLY) - private String principalName; - - /** Creates an instance of EnrollmentAccountSummaryProperties class. */ - public EnrollmentAccountSummaryProperties() { - } - - /** - * 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 86708fd37791..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.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** An instruction. */ -@Fluent -public final class InstructionInner extends ProxyResource { - /* - * A billing instruction used during invoice generation. - */ - @JsonProperty(value = "properties") - private InstructionProperties innerProperties; - - /** Creates an instance of InstructionInner class. */ - public InstructionInner() { - } - - /** - * 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 ddb06ed321ba..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InstructionProperties.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.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A billing instruction used during invoice generation. */ -@Fluent -public final class InstructionProperties { - /* - * 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; - - /** Creates an instance of InstructionProperties class. */ - public InstructionProperties() { - } - - /** - * 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")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(InstructionProperties.class); -} 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 79f7df1f60e7..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.Immutable; -import com.azure.core.management.ProxyResource; -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.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** An invoice. */ -@Immutable -public final class InvoiceInner extends ProxyResource { - /* - * An invoice. - */ - @JsonProperty(value = "properties") - private InvoiceProperties innerProperties; - - /** Creates an instance of InvoiceInner class. */ - public InvoiceInner() { - } - - /** - * 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 b7eb5925fd43..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceProperties.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.fluent.models; - -import com.azure.core.annotation.Immutable; -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.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 { - /* - * 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; - - /** Creates an instance of InvoiceProperties class. */ - public InvoiceProperties() { - } - - /** - * 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 d17c5bcdafb0..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.resourcemanager.billing.models.InvoiceSectionState; -import com.azure.resourcemanager.billing.models.TargetCloud; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An invoice section. */ -@Fluent -public final class InvoiceSectionInner extends ProxyResource { - /* - * The properties of an invoice section. - */ - @JsonProperty(value = "properties") - private InvoiceSectionProperties innerProperties; - - /** Creates an instance of InvoiceSectionInner class. */ - public InvoiceSectionInner() { - } - - /** - * 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 0165d3755e56..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceSectionProperties.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (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.resourcemanager.billing.models.InvoiceSectionState; -import com.azure.resourcemanager.billing.models.TargetCloud; -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 { - /* - * 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; - - /** Creates an instance of InvoiceSectionProperties class. */ - public InvoiceSectionProperties() { - } - - /** - * 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 21475859d3b4..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.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.JsonProperty; -import java.util.List; - -/** Invoice section properties with create subscription permission. */ -@Fluent -public final class InvoiceSectionWithCreateSubPermissionInner { - /* - * 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; - - /** Creates an instance of InvoiceSectionWithCreateSubPermissionInner class. */ - public InvoiceSectionWithCreateSubPermissionInner() { - } - - /** - * 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 a52420b8f68c..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.resourcemanager.billing.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A Billing REST API operation. */ -@Fluent -public final class OperationInner { - /* - * 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; - - /** Creates an instance of OperationInner class. */ - public OperationInner() { - } - - /** - * 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 92dfa6a9338b..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.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A policy. */ -@Fluent -public final class PolicyInner extends ProxyResource { - /* - * The properties of a policy. - */ - @JsonProperty(value = "properties") - private PolicyProperties innerProperties; - - /** Creates an instance of PolicyInner class. */ - public PolicyInner() { - } - - /** - * 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 19bd95d98255..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/PolicyProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -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.JsonProperty; - -/** The properties of a policy. */ -@Fluent -public final class PolicyProperties { - /* - * 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; - - /** Creates an instance of PolicyProperties class. */ - public PolicyProperties() { - } - - /** - * 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 7e876cc538ab..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.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.JsonProperty; -import java.time.OffsetDateTime; - -/** A product. */ -@Fluent -public final class ProductInner extends ProxyResource { - /* - * The properties of a product. - */ - @JsonProperty(value = "properties") - private ProductProperties innerProperties; - - /** Creates an instance of ProductInner class. */ - public ProductInner() { - } - - /** - * 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 971f2f5a1d75..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.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.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a product. */ -@Fluent -public final class ProductProperties { - /* - * 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; - - /** Creates an instance of ProductProperties class. */ - public ProductProperties() { - } - - /** - * 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 dfa2007edd4a..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.resourcemanager.billing.models.ReservationPropertyUtilization; -import com.azure.resourcemanager.billing.models.ReservationSkuProperty; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The definition of the reservation. */ -@Fluent -public final class ReservationInner { - /* - * 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; - - /** Creates an instance of ReservationInner class. */ - public ReservationInner() { - } - - /** - * 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 7c10570639ea..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ReservationProperty.java +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (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.resourcemanager.billing.models.ReservationPropertyUtilization; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The property of reservation object. */ -@Fluent -public final class ReservationProperty { - /* - * 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; - - /** Creates an instance of ReservationProperty class. */ - public ReservationProperty() { - } - - /** - * 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 1f63b8993658..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.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A transaction. */ -@Fluent -public final class TransactionInner extends ProxyResource { - /* - * The properties of a transaction. - */ - @JsonProperty(value = "properties") - private TransactionProperties innerProperties; - - /** Creates an instance of TransactionInner class. */ - public TransactionInner() { - } - - /** - * 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 bd7d1ca9777a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/TransactionProperties.java +++ /dev/null @@ -1,627 +0,0 @@ -// Copyright (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.resourcemanager.billing.models.Amount; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a transaction. */ -@Fluent -public final class TransactionProperties { - /* - * 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; - - /** Creates an instance of TransactionProperties class. */ - public TransactionProperties() { - } - - /** - * 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 546f80da5cf1..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.resourcemanager.billing.models.AddressDetails; -import com.azure.resourcemanager.billing.models.AddressValidationStatus; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of the address validation. */ -@Fluent -public final class ValidateAddressResponseInner { - /* - * 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; - - /** Creates an instance of ValidateAddressResponseInner class. */ - public ValidateAddressResponseInner() { - } - - /** - * 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 0bd677a082de..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateProductTransferEligibilityResultInner.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.billing.models.ValidateProductTransferEligibilityError; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Result of the product transfer eligibility validation. */ -@Fluent -public final class ValidateProductTransferEligibilityResultInner { - /* - * 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; - - /** Creates an instance of ValidateProductTransferEligibilityResultInner class. */ - public ValidateProductTransferEligibilityResultInner() { - } - - /** - * 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 575c971584ff..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/ValidateSubscriptionTransferEligibilityResultInner.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.billing.models.ValidateSubscriptionTransferEligibilityError; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Result of the transfer eligibility validation. */ -@Fluent -public final class ValidateSubscriptionTransferEligibilityResultInner { - /* - * 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; - - /** Creates an instance of ValidateSubscriptionTransferEligibilityResultInner class. */ - public ValidateSubscriptionTransferEligibilityResultInner() { - } - - /** - * 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 0fe9599abe05..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressClientImpl.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync(AddressDetails address) { - return validateWithResponseAsync(address).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateWithResponse(AddressDetails address, Context context) { - return validateWithResponseAsync(address, context).block(); - } - - /** - * 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 validateWithResponse(address, Context.NONE).getValue(); - } -} 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 be94c8c1878c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AddressImpl.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.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; - -public final class AddressImpl implements Address { - private static 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 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; - } - } - - public ValidateAddressResponse validate(AddressDetails address) { - ValidateAddressResponseInner inner = this.serviceClient().validate(address); - if (inner != null) { - return new ValidateAddressResponseImpl(inner, 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 ab49f9e9987a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (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.BillingProfileInfo; -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 BillingProfileInfo billingProfileInfo() { - return this.innerModel().billingProfileInfo(); - } - - 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 9e8ec643fcdc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsClientImpl.java +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String agreementName) { - final String expand = null; - return getWithResponseAsync(billingAccountName, agreementName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String agreementName, String expand, Context context) { - return getWithResponseAsync(billingAccountName, agreementName, expand, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 getWithResponse(billingAccountName, agreementName, expand, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 979d3d8de7df..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AgreementsImpl.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.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; - -public final class AgreementsImpl implements Agreements { - private static 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 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; - } - } - - 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; - } - } - - 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 471b34da5840..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.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.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.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 { - /** 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") - public 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String billingProfileName) { - return getWithResponseAsync(billingAccountName, billingProfileName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String billingProfileName, Context context) { - return getWithResponseAsync(billingAccountName, billingProfileName, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getWithResponse(billingAccountName, billingProfileName, Context.NONE).getValue(); - } -} 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 e07933e80e54..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesImpl.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.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; - -public final class AvailableBalancesImpl implements AvailableBalances { - private static 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 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; - } - } - - 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; - } - } - - 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 11d57989b527..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java +++ /dev/null @@ -1,927 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName) { - final String expand = null; - return getWithResponseAsync(billingAccountName, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingAccountName, String expand, Context context) { - return getWithResponseAsync(billingAccountName, expand, context).block(); - } - - /** - * 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 getWithResponse(billingAccountName, expand, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 the {@link PollerFlux} for polling of 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, - this.client.getContext()); - } - - /** - * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of a billing account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingAccountInner> beginUpdate( - String billingAccountName, BillingAccountUpdateRequest parameters) { - return this.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 the {@link SyncPoller} for polling of a billing account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingAccountInner> beginUpdate( - String billingAccountName, BillingAccountUpdateRequest parameters, Context context) { - return this.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 on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with - * {@link PagedFlux}. - */ - @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 as paginated response with - * {@link PagedFlux}. - */ - @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 as paginated response with - * {@link PagedIterable}. - */ - @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 as paginated response with - * {@link PagedIterable}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 d8ed256df537..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsImpl.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.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; - -public final class BillingAccountsImpl implements BillingAccounts { - private static 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 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 get(String billingAccountName) { - BillingAccountInner inner = this.serviceClient().get(billingAccountName); - if (inner != null) { - return new BillingAccountImpl(inner, 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 884d4f2877fd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (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.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 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 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 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() { - String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; - AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - BillingManagementClientImpl client = - new BillingManagementClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); - 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 0bd154a2b841..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientImpl.java +++ /dev/null @@ -1,557 +0,0 @@ -// Copyright (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.CoreUtils; -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 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 { - /** 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 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; - } - - /** 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; - } - - /** - * 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.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); - this.operations = new OperationsClientImpl(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) { - return CoreUtils.mergeContexts(this.getContext(), 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)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BillingManagementClientImpl.class); -} 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 f2c6a987f1cb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsClientImpl.java +++ /dev/null @@ -1,520 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingPeriodName) { - return getWithResponseAsync(billingPeriodName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingPeriodName, Context context) { - return getWithResponseAsync(billingPeriodName, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getWithResponse(billingPeriodName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 caca277c8889..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPeriodsImpl.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.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; - -public final class BillingPeriodsImpl implements BillingPeriods { - private static 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 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; - } - } - - public BillingPeriod get(String billingPeriodName) { - BillingPeriodInner inner = this.serviceClient().get(billingPeriodName); - if (inner != null) { - return new BillingPeriodImpl(inner, 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 73f902d8b417..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java +++ /dev/null @@ -1,1150 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 as paginated response with {@link - * PagedFlux}. - */ - @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 as paginated response with {@link - * PagedFlux}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 as paginated response with {@link - * PagedFlux}. - */ - @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 as paginated response with {@link - * PagedFlux}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 as paginated response with {@link - * PagedFlux}. - */ - @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 as paginated response with {@link - * PagedFlux}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 as paginated response with {@link - * PagedFlux}. - */ - @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 as paginated response with {@link - * PagedFlux}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 270cfd126b1f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsImpl.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.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; - -public final class BillingPermissionsImpl implements BillingPermissions { - private static 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 263706791197..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesClientImpl.java +++ /dev/null @@ -1,771 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String billingProfileName) { - final String expand = null; - return getWithResponseAsync(billingAccountName, billingProfileName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String billingProfileName, String expand, Context context) { - return getWithResponseAsync(billingAccountName, billingProfileName, expand, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getWithResponse(billingAccountName, billingProfileName, expand, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 the {@link PollerFlux} for polling of 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, - this.client.getContext()); - } - - /** - * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of a billing profile. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingProfileInner> beginCreateOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters) { - return this.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 the {@link SyncPoller} for polling of a billing profile. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingProfileInner> beginCreateOrUpdate( - String billingAccountName, String billingProfileName, BillingProfileInner parameters, Context context) { - return this - .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 on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 601b499b1af9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingProfilesImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (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; - -public final class BillingProfilesImpl implements BillingProfiles { - private static 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 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 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 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 ecbccb1a5717..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesClientImpl.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.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.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 { - /** 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") - public 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 along with {@link Response} on successful completion of {@link - * Mono}. - */ - @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 along with {@link Response} on successful completion of {@link - * Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync() { - return getWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(Context context) { - return getWithResponseAsync(context).block(); - } - - /** - * 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 getWithResponse(Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(BillingPropertyInner parameters) { - return updateWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(BillingPropertyInner parameters, Context context) { - return updateWithResponseAsync(parameters, 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) - public BillingPropertyInner update(BillingPropertyInner parameters) { - return updateWithResponse(parameters, Context.NONE).getValue(); - } -} 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 9a48d10fc169..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPropertiesImpl.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.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; - -public final class BillingPropertiesImpl implements BillingProperties { - private static 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 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 get() { - BillingPropertyInner inner = this.serviceClient().get(); - 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; - } - } - - public BillingProperty update(BillingPropertyInner parameters) { - BillingPropertyInner inner = this.serviceClient().update(parameters); - if (inner != null) { - return new BillingPropertyImpl(inner, 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 f7fda1ead39c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java +++ /dev/null @@ -1,1964 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link Response} on successful - * completion of {@link Mono}. - */ - @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 along with {@link Response} on successful - * completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingAccountAsync( - String billingAccountName, String billingRoleAssignmentName) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByBillingAccountAsync( - String billingAccountName, String billingRoleAssignmentName) { - return deleteByBillingAccountWithResponseAsync(billingAccountName, billingRoleAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, Context context) { - return deleteByBillingAccountWithResponseAsync(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) - public BillingRoleAssignmentInner deleteByBillingAccount( - String billingAccountName, String billingRoleAssignmentName) { - return deleteByBillingAccountWithResponse(billingAccountName, billingRoleAssignmentName, Context.NONE) - .getValue(); - } - - /** - * 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 along with {@link Response} on successful - * completion of {@link Mono}. - */ - @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 along with {@link Response} on successful - * completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - return getByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @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(); - } - - /** - * 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 getByInvoiceSectionWithResponse( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, Context.NONE) - .getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleAssignmentName) { - return deleteByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @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(); - } - - /** - * 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 deleteByInvoiceSectionWithResponse( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, Context.NONE) - .getValue(); - } - - /** - * 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 along with {@link Response} on successful - * completion of {@link Mono}. - */ - @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 along with {@link Response} on successful - * completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingProfileAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, billingRoleAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { - return getByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, 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) - public BillingRoleAssignmentInner getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return getByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleAssignmentName, Context.NONE) - .getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByBillingProfileAsync( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return deleteByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, billingRoleAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName, Context context) { - return deleteByBillingProfileWithResponseAsync( - 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) - public BillingRoleAssignmentInner deleteByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleAssignmentName) { - return deleteByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleAssignmentName, Context.NONE) - .getValue(); - } - - /** - * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 3e30ab4e79e7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsImpl.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.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; - -public final class BillingRoleAssignmentsImpl implements BillingRoleAssignments { - private static 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 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 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 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 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 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 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 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 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 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 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 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 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 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 710bb76bafa2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java +++ /dev/null @@ -1,1421 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingAccountAsync( - String billingAccountName, String billingRoleDefinitionName) { - return getByBillingAccountWithResponseAsync(billingAccountName, billingRoleDefinitionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @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 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 getByBillingAccountWithResponse(billingAccountName, billingRoleDefinitionName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByInvoiceSectionAsync( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - String billingRoleDefinitionName) { - return getByInvoiceSectionWithResponseAsync( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @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 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 getByInvoiceSectionWithResponse( - billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName, Context.NONE) - .getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingProfileAsync( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { - return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, billingRoleDefinitionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName, Context context) { - return getByBillingProfileWithResponseAsync( - billingAccountName, billingProfileName, 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) - public BillingRoleDefinitionInner getByBillingProfile( - String billingAccountName, String billingProfileName, String billingRoleDefinitionName) { - return getByBillingProfileWithResponse( - billingAccountName, billingProfileName, billingRoleDefinitionName, Context.NONE) - .getValue(); - } - - /** - * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 25e916f4eedb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsImpl.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (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; - -public final class BillingRoleDefinitionsImpl implements BillingRoleDefinitions { - private static 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 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 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 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 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 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 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 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 a4f90ebb8fd1..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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName) { - return getWithResponseAsync(billingAccountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingAccountName, Context context) { - return getWithResponseAsync(billingAccountName, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getWithResponse(billingAccountName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String billingAccountName, BillingSubscriptionInner parameters) { - return updateWithResponseAsync(billingAccountName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, Context context) { - return updateWithResponseAsync(billingAccountName, parameters, 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) - public BillingSubscriptionInner update(String billingAccountName, BillingSubscriptionInner parameters) { - return updateWithResponse(billingAccountName, parameters, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 the {@link PollerFlux} for polling of 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, - this.client.getContext()); - } - - /** - * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of a billing subscription. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingSubscriptionInner> beginMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return this.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 the {@link SyncPoller} for polling of a billing subscription. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BillingSubscriptionInner> beginMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - return this.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 on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateMoveAsync( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return validateMoveWithResponseAsync(billingAccountName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateMoveWithResponse( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Context context) { - return validateMoveWithResponseAsync(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) - public ValidateSubscriptionTransferEligibilityResultInner validateMove( - String billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return validateMoveWithResponse(billingAccountName, parameters, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 2594b8c47e86..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsImpl.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.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; - -public final class BillingSubscriptionsImpl implements BillingSubscriptions { - private static 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 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 get(String billingAccountName) { - BillingSubscriptionInner inner = this.serviceClient().get(billingAccountName); - 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 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 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 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; - } - } - - 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; - } - } - - 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 438edd7d782a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java +++ /dev/null @@ -1,814 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String customerName) { - final String expand = null; - return getWithResponseAsync(billingAccountName, customerName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String customerName, String expand, Context context) { - return getWithResponseAsync(billingAccountName, customerName, expand, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getWithResponse(billingAccountName, customerName, expand, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 eff4e8a23c29..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersImpl.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.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; - -public final class CustomersImpl implements Customers { - private static 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 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; - } - } - - 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; - } - } - - 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 27401e60f737..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsClientImpl.java +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String name) { - return getWithResponseAsync(name).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String name, Context context) { - return getWithResponseAsync(name, context).block(); - } - - /** - * 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 getWithResponse(name, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @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 f0d85d2464f8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/EnrollmentAccountsImpl.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.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; - -public final class EnrollmentAccountsImpl implements EnrollmentAccounts { - private static 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 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; - } - } - - public EnrollmentAccountSummary get(String name) { - EnrollmentAccountSummaryInner inner = this.serviceClient().get(name); - if (inner != null) { - return new EnrollmentAccountSummaryImpl(inner, 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 5f094a916875..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java +++ /dev/null @@ -1,694 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 as paginated response with {@link - * PagedFlux}. - */ - @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 as paginated response with {@link - * PagedFlux}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 as paginated response with {@link - * PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String billingAccountName, String billingProfileName, String instructionName) { - return getWithResponseAsync(billingAccountName, billingProfileName, instructionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String billingProfileName, String instructionName, Context context) { - return getWithResponseAsync(billingAccountName, billingProfileName, instructionName, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getWithResponse(billingAccountName, billingProfileName, instructionName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putAsync( - String billingAccountName, String billingProfileName, String instructionName, InstructionInner parameters) { - return putWithResponseAsync(billingAccountName, billingProfileName, instructionName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @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(); - } - - /** - * 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 putWithResponse(billingAccountName, billingProfileName, instructionName, parameters, Context.NONE) - .getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 99411de77018..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (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; - -public final class InstructionsImpl implements Instructions { - private static 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 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 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 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; - } - } - - 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; - } - } - - 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 52223c1c5260..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java +++ /dev/null @@ -1,850 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String billingAccountName, String billingProfileName, String invoiceSectionName) { - return getWithResponseAsync(billingAccountName, billingProfileName, invoiceSectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountName, String billingProfileName, String invoiceSectionName, Context context) { - return getWithResponseAsync(billingAccountName, billingProfileName, invoiceSectionName, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 getWithResponse(billingAccountName, billingProfileName, invoiceSectionName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 the {@link PollerFlux} for polling of 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, - this.client.getContext()); - } - - /** - * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of an invoice section. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, InvoiceSectionInner> beginCreateOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters) { - return this - .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 the {@link SyncPoller} for polling of an invoice section. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, InvoiceSectionInner> beginCreateOrUpdate( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - InvoiceSectionInner parameters, - Context context) { - return this - .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 on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 0174539a0144..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (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; - -public final class InvoiceSectionsImpl implements InvoiceSections { - private static 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 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 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 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 a3744a74d328..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java +++ /dev/null @@ -1,2381 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link - * Mono}. - */ - @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 along with {@link Response} on successful completion of {@link - * Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String invoiceName) { - return getWithResponseAsync(billingAccountName, invoiceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingAccountName, String invoiceName, Context context) { - return getWithResponseAsync(billingAccountName, invoiceName, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 getWithResponse(billingAccountName, invoiceName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByIdAsync(String invoiceName) { - return getByIdWithResponseAsync(invoiceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByIdWithResponse(String invoiceName, Context context) { - return getByIdWithResponseAsync(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) - public InvoiceInner getById(String invoiceName) { - return getByIdWithResponse(invoiceName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 the {@link PollerFlux} for polling of 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, - this.client.getContext()); - } - - /** - * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadInvoice( - String billingAccountName, String invoiceName, String downloadToken) { - return this.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 the {@link SyncPoller} for polling of 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 this.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 on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @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 - * along with {@link Response} on successful completion of {@link Mono}. - */ - @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 - * along with {@link Response} on successful completion of {@link Mono}. - */ - @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 the {@link PollerFlux} for polling of 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, - this.client.getContext()); - } - - /** - * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of 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 this.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 the {@link SyncPoller} for polling of 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 this - .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 on - * successful completion of {@link Mono}. - */ - @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 on - * successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getBySubscriptionAndInvoiceIdAsync(String invoiceName) { - return getBySubscriptionAndInvoiceIdWithResponseAsync(invoiceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, Context context) { - return getBySubscriptionAndInvoiceIdWithResponseAsync(invoiceName, context).block(); - } - - /** - * 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 getBySubscriptionAndInvoiceIdWithResponse(invoiceName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 the {@link PollerFlux} for polling of 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, - this.client.getContext()); - } - - /** - * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken) { - return this.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 the {@link SyncPoller} for polling of a URL to download an invoice. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DownloadUrlInner> beginDownloadBillingSubscriptionInvoice( - String invoiceName, String downloadToken, Context context) { - return this.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 on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @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 - * along with {@link Response} on successful completion of {@link Mono}. - */ - @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 - * along with {@link Response} on successful completion of {@link Mono}. - */ - @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 the {@link PollerFlux} for polling of 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, - this.client.getContext()); - } - - /** - * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of 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 this.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 the {@link SyncPoller} for polling of 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 this.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 on - * successful completion of {@link Mono}. - */ - @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 on - * successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 451e91615830..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesImpl.java +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (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 java.util.List; - -public final class InvoicesImpl implements Invoices { - private static 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 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 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 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 Invoice getById(String invoiceName) { - InvoiceInner inner = this.serviceClient().getById(invoiceName); - if (inner != null) { - return new InvoiceImpl(inner, 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 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 Invoice getBySubscriptionAndInvoiceId(String invoiceName) { - InvoiceInner inner = this.serviceClient().getBySubscriptionAndInvoiceId(invoiceName); - if (inner != null) { - return new InvoiceImpl(inner, 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 50522ff957bd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with - * {@link PagedFlux}. - */ - @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 as paginated response with - * {@link PagedFlux}. - */ - @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 as paginated response with - * {@link PagedIterable}. - */ - @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 as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 bfb38b193ea8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/OperationsImpl.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.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; - -public final class OperationsImpl implements Operations { - private static 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 b4434dc1de79..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java +++ /dev/null @@ -1,673 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingProfileAsync(String billingAccountName, String billingProfileName) { - return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, Context context) { - return getByBillingProfileWithResponseAsync(billingAccountName, billingProfileName, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getByBillingProfileWithResponse(billingAccountName, billingProfileName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String billingAccountName, String billingProfileName, PolicyInner parameters) { - return updateWithResponseAsync(billingAccountName, billingProfileName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String billingAccountName, String billingProfileName, PolicyInner parameters, Context context) { - return updateWithResponseAsync(billingAccountName, billingProfileName, parameters, 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) - public PolicyInner update(String billingAccountName, String billingProfileName, PolicyInner parameters) { - return updateWithResponse(billingAccountName, billingProfileName, parameters, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByCustomerAsync(String billingAccountName, String customerName) { - return getByCustomerWithResponseAsync(billingAccountName, customerName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByCustomerWithResponse( - String billingAccountName, String customerName, Context context) { - return getByCustomerWithResponseAsync(billingAccountName, customerName, 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) - public CustomerPolicyInner getByCustomer(String billingAccountName, String customerName) { - return getByCustomerWithResponse(billingAccountName, customerName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateCustomerAsync( - String billingAccountName, String customerName, CustomerPolicyInner parameters) { - return updateCustomerWithResponseAsync(billingAccountName, customerName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateCustomerWithResponse( - String billingAccountName, String customerName, CustomerPolicyInner parameters, Context context) { - return updateCustomerWithResponseAsync(billingAccountName, customerName, parameters, 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) - public CustomerPolicyInner updateCustomer( - String billingAccountName, String customerName, CustomerPolicyInner parameters) { - return updateCustomerWithResponse(billingAccountName, customerName, parameters, Context.NONE).getValue(); - } -} 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 ef9dc5a97034..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (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; - -public final class PoliciesImpl implements Policies { - private static 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 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 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 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 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 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 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 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; - } - } - - 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; - } - } - - 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 6dbdf32dc329..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java +++ /dev/null @@ -1,1887 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String billingAccountName, String productName) { - return getWithResponseAsync(billingAccountName, productName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String billingAccountName, String productName, Context context) { - return getWithResponseAsync(billingAccountName, productName, context).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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getWithResponse(billingAccountName, productName, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String billingAccountName, String productName, ProductInner parameters) { - return updateWithResponseAsync(billingAccountName, productName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String billingAccountName, String productName, ProductInner parameters, Context context) { - return updateWithResponseAsync(billingAccountName, productName, parameters, 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) - public ProductInner update(String billingAccountName, String productName, ProductInner parameters) { - return updateWithResponse(billingAccountName, productName, parameters, Context.NONE).getValue(); - } - - /** - * 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 on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono moveAsync( - String billingAccountName, String productName, TransferProductRequestProperties parameters) { - return moveWithResponseAsync(billingAccountName, productName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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(); - } - - /** - * 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 moveWithResponse(billingAccountName, productName, parameters, Context.NONE).getValue(); - } - - /** - * 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 along with {@link Response} on successful - * completion of {@link Mono}. - */ - @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 along with {@link Response} on successful - * completion of {@link Mono}. - */ - @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateMoveAsync( - String billingAccountName, String productName, TransferProductRequestProperties parameters) { - return validateMoveWithResponseAsync(billingAccountName, productName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateMoveWithResponse( - String billingAccountName, String productName, TransferProductRequestProperties parameters, Context context) { - return validateMoveWithResponseAsync(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) - public ValidateProductTransferEligibilityResultInner validateMove( - String billingAccountName, String productName, TransferProductRequestProperties parameters) { - return validateMoveWithResponse(billingAccountName, productName, parameters, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 0b370b87e728..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsImpl.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (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; - -public final class ProductsImpl implements Products { - private static 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 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 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 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 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 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 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 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; - } - } - - 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; - } - } - - 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 63a7793a8cf7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java +++ /dev/null @@ -1,791 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated - * response with {@link PagedFlux}. - */ - @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 as paginated - * response with {@link PagedFlux}. - */ - @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 as paginated - * response with {@link PagedFlux}. - */ - @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 as paginated - * response with {@link PagedIterable}. - */ - @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 as paginated - * response with {@link PagedIterable}. - */ - @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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated - * response with {@link PagedFlux}. - */ - @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 as paginated - * response with {@link PagedFlux}. - */ - @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 as paginated - * response with {@link PagedFlux}. - */ - @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 as paginated - * response with {@link PagedIterable}. - */ - @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 as paginated - * response with {@link PagedIterable}. - */ - @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 URL to get the next list of items - *

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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @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 9c1c5969fe4a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsImpl.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.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; - -public final class ReservationsImpl implements Reservations { - private static 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 ff53b98e4d20..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsClientImpl.java +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright (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.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 { - /** 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") - public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 93d5a0882b4f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/TransactionsImpl.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.TransactionsClient; -import com.azure.resourcemanager.billing.fluent.models.TransactionInner; -import com.azure.resourcemanager.billing.models.Transaction; -import com.azure.resourcemanager.billing.models.Transactions; - -public final class TransactionsImpl implements Transactions { - private static 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 68440555fd9b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AcceptanceMode.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The mode of acceptance for an agreement. */ -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 a new instance of AcceptanceMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AcceptanceMode() { - } - - /** - * 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); - } - - /** - * Gets known AcceptanceMode values. - * - * @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 b43cb6a735c3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AccountStatus.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; - -/** The current status of the billing account. */ -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 a new instance of AccountStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AccountStatus() { - } - - /** - * 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); - } - - /** - * Gets known AccountStatus values. - * - * @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 23d62c4364fe..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AccountType.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of customer. */ -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 a new instance of AccountType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AccountType() { - } - - /** - * 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); - } - - /** - * Gets known AccountType values. - * - * @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 739ad62255df..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. - * @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 along with {@link Response}. - */ - Response validateWithResponse(AddressDetails address, 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 com.azure.core.management.exception.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); -} 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 ff2c4453802d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressDetails.java +++ /dev/null @@ -1,401 +0,0 @@ -// Copyright (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.JsonProperty; - -/** Address details. */ -@Fluent -public final class AddressDetails { - /* - * 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; - - /** Creates an instance of AddressDetails class. */ - public AddressDetails() { - } - - /** - * 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")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AddressDetails.class); -} 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 2eeeae18abf6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AddressValidationStatus.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Status of the address validation. */ -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 a new instance of AddressValidationStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AddressValidationStatus() { - } - - /** - * 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); - } - - /** - * Gets known AddressValidationStatus values. - * - * @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 fde5b5b32687..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Agreement.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (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 billingProfileInfo property: The list of billing profiles associated with agreement and present only for - * specific agreements. - * - * @return the billingProfileInfo value. - */ - BillingProfileInfo billingProfileInfo(); - - /** - * 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 6a55ec05b7be..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.resourcemanager.billing.fluent.models.AgreementInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of listing agreements. */ -@Immutable -public final class AgreementListResult { - /* - * 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; - - /** Creates an instance of AgreementListResult class. */ - public AgreementListResult() { - } - - /** - * 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 d2d0f655c416..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AgreementType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of agreement. */ -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 a new instance of AgreementType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AgreementType() { - } - - /** - * 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); - } - - /** - * Gets known AgreementType values. - * - * @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 38e414229f42..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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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. - * @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 along with {@link Response}. - */ - Response getWithResponse( - String billingAccountName, String agreementName, 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); -} 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 81a8d20b9d29..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.fasterxml.jackson.annotation.JsonProperty; - -/** The amount. */ -@Fluent -public final class Amount { - /* - * 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; - - /** Creates an instance of Amount class. */ - public Amount() { - } - - /** - * 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 bf3b14740ded..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AutoRenew.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Indicates whether auto renewal is turned on or off for a product. */ -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 a new instance of AutoRenew value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AutoRenew() { - } - - /** - * 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); - } - - /** - * Gets known AutoRenew values. - * - * @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 206474c3a645..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. - * @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 along with {@link Response}. - */ - Response getWithResponse(String billingAccountName, String billingProfileName, 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 com.azure.core.management.exception.ManagementException 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); -} 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 86eca5b75ba4..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.fasterxml.jackson.annotation.JsonProperty; - -/** Details of the Azure plan. */ -@Fluent -public final class AzurePlan { - /* - * The sku id. - */ - @JsonProperty(value = "skuId") - private String skuId; - - /* - * The sku description. - */ - @JsonProperty(value = "skuDescription", access = JsonProperty.Access.WRITE_ONLY) - private String skuDescription; - - /** Creates an instance of AzurePlan class. */ - public AzurePlan() { - } - - /** - * 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 8671d7729a76..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.resourcemanager.billing.fluent.models.BillingAccountInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of billing accounts. */ -@Immutable -public final class BillingAccountListResult { - /* - * 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; - - /** Creates an instance of BillingAccountListResult class. */ - public BillingAccountListResult() { - } - - /** - * 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 15afe141a31f..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.resourcemanager.billing.fluent.models.BillingAccountProperties; -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 { - /* - * A billing property. - */ - @JsonProperty(value = "properties") - private BillingAccountProperties innerProperties; - - /** Creates an instance of BillingAccountUpdateRequest class. */ - public BillingAccountUpdateRequest() { - } - - /** - * 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 0846c2adf9c5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingAccounts.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String expand, Context 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. - * @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 along with {@link Response}. - */ - Response getWithResponse(String billingAccountName, 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); - - /** - * 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 as paginated response with - * {@link PagedIterable}. - */ - 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 as paginated response with - * {@link PagedIterable}. - */ - 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 cc059ecdbaf8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingFrequency.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The frequency at which the product will be billed. */ -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 a new instance of BillingFrequency value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BillingFrequency() { - } - - /** - * 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); - } - - /** - * Gets known BillingFrequency values. - * - * @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 7ea051335afc..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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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. - * @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 along with {@link Response}. - */ - Response getWithResponse(String billingPeriodName, 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); -} 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 8e0037413f78..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.resourcemanager.billing.fluent.models.BillingPeriodInner; -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 { - /* - * 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; - - /** Creates an instance of BillingPeriodsListResult class. */ - public BillingPeriodsListResult() { - } - - /** - * 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 db63bcc0dbb6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingPermissions.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.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 as paginated response with {@link - * PagedIterable}. - */ - 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 as paginated response with {@link - * PagedIterable}. - */ - 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 as paginated response with {@link - * PagedIterable}. - */ - 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 as paginated response with {@link - * PagedIterable}. - */ - 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 as paginated response with {@link - * PagedIterable}. - */ - 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 as paginated response with {@link - * PagedIterable}. - */ - 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 as paginated response with {@link - * PagedIterable}. - */ - 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 as paginated response with {@link - * PagedIterable}. - */ - 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 6407b8a85a3a..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.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -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 { - /* - * 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; - - /** Creates an instance of BillingPermissionsListResult class. */ - public BillingPermissionsListResult() { - } - - /** - * 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/BillingProfileInfo.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileInfo.java deleted file mode 100644 index d8b35e9983f8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileInfo.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Details about billing profile associated with agreement and available only for specific agreements. */ -@Fluent -public final class BillingProfileInfo { - /* - * The unique identifier for the billing profile. - */ - @JsonProperty(value = "billingProfileId") - private String billingProfileId; - - /* - * The name of the billing profile - */ - @JsonProperty(value = "billingProfileDisplayName") - private String billingProfileDisplayName; - - /* - * Billing account name. This property is available for a specific type of agreement. - */ - @JsonProperty(value = "indirectRelationshipOrganizationName") - private String indirectRelationshipOrganizationName; - - /** Creates an instance of BillingProfileInfo class. */ - public BillingProfileInfo() { - } - - /** - * Get the billingProfileId property: The unique identifier for the billing profile. - * - * @return the billingProfileId value. - */ - public String billingProfileId() { - return this.billingProfileId; - } - - /** - * Set the billingProfileId property: The unique identifier for the billing profile. - * - * @param billingProfileId the billingProfileId value to set. - * @return the BillingProfileInfo object itself. - */ - public BillingProfileInfo withBillingProfileId(String billingProfileId) { - this.billingProfileId = billingProfileId; - return this; - } - - /** - * Get the billingProfileDisplayName property: The name of the billing profile. - * - * @return the billingProfileDisplayName value. - */ - public String billingProfileDisplayName() { - return this.billingProfileDisplayName; - } - - /** - * Set the billingProfileDisplayName property: The name of the billing profile. - * - * @param billingProfileDisplayName the billingProfileDisplayName value to set. - * @return the BillingProfileInfo object itself. - */ - public BillingProfileInfo withBillingProfileDisplayName(String billingProfileDisplayName) { - this.billingProfileDisplayName = billingProfileDisplayName; - return this; - } - - /** - * Get the indirectRelationshipOrganizationName property: Billing account name. This property is available for a - * specific type of agreement. - * - * @return the indirectRelationshipOrganizationName value. - */ - public String indirectRelationshipOrganizationName() { - return this.indirectRelationshipOrganizationName; - } - - /** - * Set the indirectRelationshipOrganizationName property: Billing account name. This property is available for a - * specific type of agreement. - * - * @param indirectRelationshipOrganizationName the indirectRelationshipOrganizationName value to set. - * @return the BillingProfileInfo object itself. - */ - public BillingProfileInfo withIndirectRelationshipOrganizationName(String indirectRelationshipOrganizationName) { - this.indirectRelationshipOrganizationName = indirectRelationshipOrganizationName; - 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/BillingProfileListResult.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileListResult.java deleted file mode 100644 index 454ceba27857..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileListResult.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.resourcemanager.billing.fluent.models.BillingProfileInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of billing profiles. */ -@Immutable -public final class BillingProfileListResult { - /* - * The list of billing profiles. - */ - @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; - - /** Creates an instance of BillingProfileListResult class. */ - public BillingProfileListResult() { - } - - /** - * Get the value property: The list of billing profiles. - * - * @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/BillingProfileSpendingLimit.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileSpendingLimit.java deleted file mode 100644 index df0c6db6f767..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileSpendingLimit.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The billing profile spending limit. */ -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 a new instance of BillingProfileSpendingLimit value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BillingProfileSpendingLimit() { - } - - /** - * 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); - } - - /** - * Gets known BillingProfileSpendingLimit values. - * - * @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 f842206667c6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileStatus.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The status of the billing profile. */ -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 a new instance of BillingProfileStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BillingProfileStatus() { - } - - /** - * 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); - } - - /** - * Gets known BillingProfileStatus values. - * - * @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 5c269ef7e649..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfileStatusReasonCode.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Reason for the specified billing profile status. */ -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 a new instance of BillingProfileStatusReasonCode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BillingProfileStatusReasonCode() { - } - - /** - * 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); - } - - /** - * Gets known BillingProfileStatusReasonCode values. - * - * @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 a07795c96dc0..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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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. - * @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 along with {@link Response}. - */ - Response getWithResponse( - String billingAccountName, String billingProfileName, 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); - - /** - * 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/BillingProfilesOnExpand.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesOnExpand.java deleted file mode 100644 index 065cefc415ee..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingProfilesOnExpand.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.resourcemanager.billing.fluent.models.BillingProfileInner; -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 { - /* - * 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; - - /** Creates an instance of BillingProfilesOnExpand class. */ - public BillingProfilesOnExpand() { - } - - /** - * 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 84c357a8fe6e..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. - * - * @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 along with {@link Response}. - */ - Response getWithResponse(Context context); - - /** - * 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(); - - /** - * 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 along with {@link Response}. - */ - Response updateWithResponse(BillingPropertyInner parameters, 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); -} 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 18733a223b10..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingRelationshipType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Identifies which services and purchases are paid by a billing profile. */ -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 a new instance of BillingRelationshipType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BillingRelationshipType() { - } - - /** - * 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); - } - - /** - * Gets known BillingRelationshipType values. - * - * @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 0c8573b0a5f9..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.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of role assignments. */ -@Immutable -public final class BillingRoleAssignmentListResult { - /* - * 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; - - /** Creates an instance of BillingRoleAssignmentListResult class. */ - public BillingRoleAssignmentListResult() { - } - - /** - * 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 b97391901fb8..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. - * @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 along with {@link Response}. - */ - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleAssignmentName, 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 com.azure.core.management.exception.ManagementException 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); - - /** - * 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 along with {@link Response}. - */ - Response deleteByBillingAccountWithResponse( - 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); - - /** - * 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 along with {@link Response}. - */ - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - 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); - - /** - * 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 along with {@link Response}. - */ - Response deleteByInvoiceSectionWithResponse( - 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); - - /** - * 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 along with {@link Response}. - */ - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, 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); - - /** - * 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 along with {@link Response}. - */ - Response deleteByBillingProfileWithResponse( - 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); - - /** - * 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 80c001a0a086..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.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of role definitions. */ -@Immutable -public final class BillingRoleDefinitionListResult { - /* - * 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; - - /** Creates an instance of BillingRoleDefinitionListResult class. */ - public BillingRoleDefinitionListResult() { - } - - /** - * 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 2bad7e3a7929..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. - * @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 along with {@link Response}. - */ - Response getByBillingAccountWithResponse( - String billingAccountName, String billingRoleDefinitionName, 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 com.azure.core.management.exception.ManagementException 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 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 along with {@link Response}. - */ - Response getByInvoiceSectionWithResponse( - String billingAccountName, - String billingProfileName, - String invoiceSectionName, - 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 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 along with {@link Response}. - */ - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, 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); - - /** - * 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 e49b6f824f83..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/BillingSubscriptionStatusType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The current billing status of the subscription. */ -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 a new instance of BillingSubscriptionStatusType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BillingSubscriptionStatusType() { - } - - /** - * 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); - } - - /** - * Gets known BillingSubscriptionStatusType values. - * - * @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 f2898f82f82a..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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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. - * @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 along with {@link Response}. - */ - Response getWithResponse(String billingAccountName, 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); - - /** - * 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 along with {@link Response}. - */ - Response updateWithResponse( - String billingAccountName, BillingSubscriptionInner parameters, 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); - - /** - * 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. - * @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 along with {@link Response}. - */ - Response validateMoveWithResponse( - 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); -} 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 9593b2711cd0..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.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of billing subscriptions. */ -@Immutable -public final class BillingSubscriptionsListResult { - /* - * 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; - - /** Creates an instance of BillingSubscriptionsListResult class. */ - public BillingSubscriptionsListResult() { - } - - /** - * 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/Category.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Category.java deleted file mode 100644 index 832b22ac73f4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Category.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The category of the agreement signed by a customer. */ -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 a new instance of Category value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Category() { - } - - /** - * 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); - } - - /** - * Gets known Category values. - * - * @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 771a360eb85e..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.resourcemanager.billing.fluent.models.CustomerInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of customers. */ -@Immutable -public final class CustomerListResult { - /* - * 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; - - /** Creates an instance of CustomerListResult class. */ - public CustomerListResult() { - } - - /** - * 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 1cf38aede92c..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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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. - * @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 along with {@link Response}. - */ - Response getWithResponse(String billingAccountName, String customerName, String expand, 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); -} 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 f706b53a7be9..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.resourcemanager.billing.fluent.models.DepartmentProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A department. */ -@Fluent -public final class Department extends ProxyResource { - /* - * A department. - */ - @JsonProperty(value = "properties") - private DepartmentProperties innerProperties; - - /** Creates an instance of Department class. */ - public Department() { - } - - /** - * 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 38c0dada032a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Document.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.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of a document. */ -@Immutable -public final class Document { - /* - * 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; - - /** Creates an instance of Document class. */ - public Document() { - } - - /** - * 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 fe799635cce6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DocumentSource.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The source of the document. ENF for Brazil and DRS for rest of the world. */ -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 a new instance of DocumentSource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DocumentSource() { - } - - /** - * 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); - } - - /** - * Gets known DocumentSource values. - * - * @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 c6ac874e5c3c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/DocumentType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of the document. */ -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 a new instance of DocumentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DocumentType() { - } - - /** - * 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); - } - - /** - * Gets known DocumentType values. - * - * @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 0655e4378224..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.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of an enrollment. */ -@Fluent -public final class Enrollment { - /* - * 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; - - /** Creates an instance of Enrollment class. */ - public Enrollment() { - } - - /** - * 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 c1209ebcf0d7..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.resourcemanager.billing.fluent.models.EnrollmentAccountProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** An enrollment account. */ -@Fluent -public final class EnrollmentAccount extends ProxyResource { - /* - * The properties of an enrollment account. - */ - @JsonProperty(value = "properties") - private EnrollmentAccountProperties innerProperties; - - /** Creates an instance of EnrollmentAccount class. */ - public EnrollmentAccount() { - } - - /** - * 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 e27dab10a0af..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.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of listing enrollment accounts. */ -@Immutable -public final class EnrollmentAccountListResult { - /* - * 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; - - /** Creates an instance of EnrollmentAccountListResult class. */ - public EnrollmentAccountListResult() { - } - - /** - * 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 556421ab3c39..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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * 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 along with {@link Response}. - */ - Response getWithResponse(String name, 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); -} 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 ee53bffd0ca6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/EnrollmentPolicies.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (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.fasterxml.jackson.annotation.JsonProperty; - -/** The policies for Enterprise Agreement enrollments. */ -@Immutable -public final class EnrollmentPolicies { - /* - * 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; - - /** Creates an instance of EnrollmentPolicies class. */ - public EnrollmentPolicies() { - } - - /** - * 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 23b1a61c4839..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/IndirectRelationshipInfo.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (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.fasterxml.jackson.annotation.JsonProperty; - -/** The billing profile details of the partner of the customer for an indirect motion. */ -@Fluent -public final class IndirectRelationshipInfo { - /* - * 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; - - /** Creates an instance of IndirectRelationshipInfo class. */ - public IndirectRelationshipInfo() { - } - - /** - * 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 c5c21be50463..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.resourcemanager.billing.fluent.models.InstructionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of billing instructions used during invoice generation. */ -@Immutable -public final class InstructionListResult { - /* - * 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; - - /** Creates an instance of InstructionListResult class. */ - public InstructionListResult() { - } - - /** - * 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 cb9c96e4b574..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Instructions.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (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 as paginated response with {@link - * PagedIterable}. - */ - 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 as paginated response with {@link - * PagedIterable}. - */ - 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. - * @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 along with {@link Response}. - */ - Response getWithResponse( - String billingAccountName, String billingProfileName, String instructionName, 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); - - /** - * 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 along with {@link Response}. - */ - Response putWithResponse( - String billingAccountName, - String billingProfileName, - String instructionName, - InstructionInner parameters, - 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); -} 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 62220f0a03d7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceDocumentType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of the document. */ -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 a new instance of InvoiceDocumentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public InvoiceDocumentType() { - } - - /** - * 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); - } - - /** - * Gets known InvoiceDocumentType values. - * - * @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 ce13fcbc1a01..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceListResult.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.resourcemanager.billing.fluent.models.InvoiceInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of invoices. */ -@Immutable -public final class InvoiceListResult { - /* - * 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; - - /* - * Total number of records. - */ - @JsonProperty(value = "totalCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer totalCount; - - /** Creates an instance of InvoiceListResult class. */ - public InvoiceListResult() { - } - - /** - * 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; - } - - /** - * Get the totalCount property: Total number of records. - * - * @return the totalCount value. - */ - public Integer totalCount() { - return this.totalCount; - } - - /** - * 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 6f2e48d840c5..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.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of invoice sections. */ -@Immutable -public final class InvoiceSectionListResult { - /* - * 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; - - /** Creates an instance of InvoiceSectionListResult class. */ - public InvoiceSectionListResult() { - } - - /** - * 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 aa8564c38ab5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionListWithCreateSubPermissionResult.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionWithCreateSubPermissionInner; -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 { - /* - * 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; - - /** Creates an instance of InvoiceSectionListWithCreateSubPermissionResult class. */ - public InvoiceSectionListWithCreateSubPermissionResult() { - } - - /** - * 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 de0e2461b51f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionState.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Identifies the state of an invoice section. */ -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 a new instance of InvoiceSectionState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public InvoiceSectionState() { - } - - /** - * 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); - } - - /** - * Gets known InvoiceSectionState values. - * - * @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 82e25a50ccdf..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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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. - * @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 along with {@link Response}. - */ - Response getWithResponse( - String billingAccountName, String billingProfileName, String invoiceSectionName, 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); - - /** - * 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/InvoiceSectionsOnExpand.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsOnExpand.java deleted file mode 100644 index 2ad9ff909e9d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceSectionsOnExpand.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.resourcemanager.billing.fluent.models.InvoiceSectionInner; -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 { - /* - * 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; - - /** Creates an instance of InvoiceSectionsOnExpand class. */ - public InvoiceSectionsOnExpand() { - } - - /** - * 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 652cab0778de..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceStatus.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The current status of the invoice. */ -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 a new instance of InvoiceStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public InvoiceStatus() { - } - - /** - * 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); - } - - /** - * Gets known InvoiceStatus values. - * - * @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 97eb337d8ccd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/InvoiceType.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Invoice type. */ -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 a new instance of InvoiceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public InvoiceType() { - } - - /** - * 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); - } - - /** - * Gets known InvoiceType values. - * - * @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 a9b21a5dcb9e..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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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. - * @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 along with {@link Response}. - */ - Response getWithResponse(String billingAccountName, String invoiceName, 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 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 along with {@link Response}. - */ - Response getByIdWithResponse(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 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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. - * @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 along with {@link Response}. - */ - Response getBySubscriptionAndInvoiceIdWithResponse(String invoiceName, 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 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/MarketplacePurchasesPolicy.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/MarketplacePurchasesPolicy.java deleted file mode 100644 index 71a81d6fc17b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/MarketplacePurchasesPolicy.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The policy that controls whether Azure marketplace purchases are allowed for a billing profile. */ -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 a new instance of MarketplacePurchasesPolicy value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MarketplacePurchasesPolicy() { - } - - /** - * 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); - } - - /** - * Gets known MarketplacePurchasesPolicy values. - * - * @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 9dbcadbfa3e1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationDisplay.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.fasterxml.jackson.annotation.JsonProperty; - -/** The object that represents the operation. */ -@Immutable -public final class OperationDisplay { - /* - * 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; - - /** Creates an instance of OperationDisplay class. */ - public OperationDisplay() { - } - - /** - * 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 9bac4604cb54..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/OperationListResult.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.resourcemanager.billing.fluent.models.OperationInner; -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 { - /* - * 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; - - /** Creates an instance of OperationListResult class. */ - public OperationListResult() { - } - - /** - * 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 bdd2d70c2d9b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Operations.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.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 as paginated response with - * {@link PagedIterable}. - */ - 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 as paginated response with - * {@link PagedIterable}. - */ - 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 68e57371376b..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.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The details about a participant. */ -@Immutable -public final class Participants { - /* - * 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; - - /** Creates an instance of Participants class. */ - public Participants() { - } - - /** - * 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 82fbccebdb8b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/PaymentMethodFamily.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The family of payment method. */ -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 a new instance of PaymentMethodFamily value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PaymentMethodFamily() { - } - - /** - * 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); - } - - /** - * Gets known PaymentMethodFamily values. - * - * @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 671c093c5b67..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.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The properties of a payment. */ -@Fluent -public final class PaymentProperties { - /* - * 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; - - /** Creates an instance of PaymentProperties class. */ - public PaymentProperties() { - } - - /** - * 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 d797634d6296..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. - * @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 along with {@link Response}. - */ - Response getByBillingProfileWithResponse( - String billingAccountName, String billingProfileName, 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 com.azure.core.management.exception.ManagementException 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); - - /** - * 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 along with {@link Response}. - */ - Response updateWithResponse( - String billingAccountName, String billingProfileName, PolicyInner parameters, 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); - - /** - * 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 along with {@link Response}. - */ - Response getByCustomerWithResponse(String billingAccountName, String customerName, 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); - - /** - * 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 along with {@link Response}. - */ - Response updateCustomerWithResponse( - String billingAccountName, String customerName, CustomerPolicyInner parameters, 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); -} 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 d545bc2b4a64..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductStatusType.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The current status of the product. */ -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 a new instance of ProductStatusType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProductStatusType() { - } - - /** - * 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); - } - - /** - * Gets known ProductStatusType values. - * - * @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 10e0651a7b91..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductTransferValidationErrorCode.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (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; - -/** Error code of the transfer validation response. */ -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 a new instance of ProductTransferValidationErrorCode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProductTransferValidationErrorCode() { - } - - /** - * 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); - } - - /** - * Gets known ProductTransferValidationErrorCode values. - * - * @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 9d0ce896b9e9..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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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. - * @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 along with {@link Response}. - */ - Response getWithResponse(String billingAccountName, String productName, 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); - - /** - * 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 along with {@link Response}. - */ - Response updateWithResponse( - String billingAccountName, String productName, ProductInner parameters, 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); - - /** - * 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); - - /** - * 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); - - /** - * 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 along with {@link Response}. - */ - Response validateMoveWithResponse( - 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); -} 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 8b2aa24b2751..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.resourcemanager.billing.fluent.models.ProductInner; -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 { - /* - * 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; - - /** Creates an instance of ProductsListResult class. */ - public ProductsListResult() { - } - - /** - * 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 29900c577be0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsMoveHeaders.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.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ProductsMoveHeaders model. */ -@Fluent -public final class ProductsMoveHeaders { - /* - * The Retry-After property. - */ - @JsonProperty(value = "Retry-After") - private Integer retryAfter; - - /* - * The Location property. - */ - @JsonProperty(value = "Location") - private String location; - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of ProductsMoveHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public ProductsMoveHeaders(HttpHeaders rawHeaders) { - String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER); - if (retryAfter != null) { - this.retryAfter = Integer.parseInt(retryAfter); - } - this.location = rawHeaders.getValue(HttpHeaderName.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 f328dbe14e5e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ProductsMoveResponse.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.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); - } - - /** - * Gets the deserialized response body. - * - * @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 9a6552cd6b61..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.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 { - /* - * 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; - - /** Creates an instance of RebillDetails class. */ - public 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 ac30a2d0394d..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.fasterxml.jackson.annotation.JsonProperty; - -/** Details of the reseller. */ -@Immutable -public final class Reseller { - /* - * 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; - - /** Creates an instance of Reseller class. */ - public Reseller() { - } - - /** - * 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 2498b8c592e1..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.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Reservation utilization. */ -@Fluent -public final class ReservationPropertyUtilization { - /* - * 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; - - /** Creates an instance of ReservationPropertyUtilization class. */ - public ReservationPropertyUtilization() { - } - - /** - * 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 cf3b0dd15cee..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationPurchasesPolicy.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The policy that controls whether Azure reservation purchases are allowed for a billing profile. */ -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 a new instance of ReservationPurchasesPolicy value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ReservationPurchasesPolicy() { - } - - /** - * 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); - } - - /** - * Gets known ReservationPurchasesPolicy values. - * - * @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 1f9ceb8671d1..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.fasterxml.jackson.annotation.JsonProperty; - -/** The property of reservation sku object. */ -@Immutable -public final class ReservationSkuProperty { - /* - * The name of the reservation sku. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /** Creates an instance of ReservationSkuProperty class. */ - public ReservationSkuProperty() { - } - - /** - * 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 3e4d3c0e8d04..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.fasterxml.jackson.annotation.JsonProperty; - -/** The roll up count summary of reservations in each state. */ -@Immutable -public final class ReservationSummary { - /* - * 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; - - /** Creates an instance of ReservationSummary class. */ - public ReservationSummary() { - } - - /** - * 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 9f5edd285b61..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ReservationType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of transaction. */ -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 a new instance of ReservationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ReservationType() { - } - - /** - * 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); - } - - /** - * Gets known ReservationType values. - * - * @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 f7f9c9ed8124..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.fasterxml.jackson.annotation.JsonProperty; - -/** The aggregate values of reservation utilization. */ -@Immutable -public final class ReservationUtilizationAggregates { - /* - * 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; - - /** Creates an instance of ReservationUtilizationAggregates class. */ - public ReservationUtilizationAggregates() { - } - - /** - * 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 9a72b508b0ba..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/Reservations.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.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 as paginated - * response with {@link PagedIterable}. - */ - 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 as paginated - * response with {@link PagedIterable}. - */ - 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 as paginated - * response with {@link PagedIterable}. - */ - 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 as paginated - * response with {@link PagedIterable}. - */ - 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 8127320772a4..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.resourcemanager.billing.fluent.models.ReservationInner; -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 { - /* - * 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; - - /** Creates an instance of ReservationsListResult class. */ - public ReservationsListResult() { - } - - /** - * 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 6847f13eaa72..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SpendingLimit.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The billing profile spending limit. */ -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 a new instance of SpendingLimit value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SpendingLimit() { - } - - /** - * 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); - } - - /** - * Gets known SpendingLimit values. - * - * @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 10c7f9c82908..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SpendingLimitForBillingProfile.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The billing profile spending limit. */ -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 a new instance of SpendingLimitForBillingProfile value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SpendingLimitForBillingProfile() { - } - - /** - * 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); - } - - /** - * Gets known SpendingLimitForBillingProfile values. - * - * @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 e1cc96efe345..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/StatusReasonCode.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Reason for the specified billing profile status. */ -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 a new instance of StatusReasonCode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public StatusReasonCode() { - } - - /** - * 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); - } - - /** - * Gets known StatusReasonCode values. - * - * @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 996f2335ccde..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/StatusReasonCodeForBillingProfile.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Reason for the specified billing profile status. */ -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 a new instance of StatusReasonCodeForBillingProfile value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public StatusReasonCodeForBillingProfile() { - } - - /** - * 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); - } - - /** - * Gets known StatusReasonCodeForBillingProfile values. - * - * @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 b69d6fdf778e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/SubscriptionTransferValidationErrorCode.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (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; - -/** Error code of the transfer validation response. */ -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 a new instance of SubscriptionTransferValidationErrorCode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SubscriptionTransferValidationErrorCode() { - } - - /** - * 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); - } - - /** - * Gets known SubscriptionTransferValidationErrorCode values. - * - * @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 6d2d4baa8945..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TargetCloud.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Possible cloud environments. */ -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 a new instance of TargetCloud value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TargetCloud() { - } - - /** - * 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); - } - - /** - * Gets known TargetCloud values. - * - * @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 16ecbebca4d3..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.resourcemanager.billing.fluent.models.TransactionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The list of transactions. */ -@Immutable -public final class TransactionListResult { - /* - * 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; - - /** Creates an instance of TransactionListResult class. */ - public TransactionListResult() { - } - - /** - * 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 2dc76550105d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransactionTypeKind.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The kind of transaction. Options are all or reservation. */ -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 a new instance of TransactionTypeKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TransactionTypeKind() { - } - - /** - * 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); - } - - /** - * Gets known TransactionTypeKind values. - * - * @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 83c44ea52759..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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 87f43e0da6c5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/TransferBillingSubscriptionRequestProperties.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.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request parameters to transfer billing subscription. */ -@Fluent -public final class TransferBillingSubscriptionRequestProperties { - /* - * The destination invoice section id. - */ - @JsonProperty(value = "destinationInvoiceSectionId", required = true) - private String destinationInvoiceSectionId; - - /** Creates an instance of TransferBillingSubscriptionRequestProperties class. */ - public TransferBillingSubscriptionRequestProperties() { - } - - /** - * 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")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TransferBillingSubscriptionRequestProperties.class); -} 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 8aa7f6904004..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.fasterxml.jackson.annotation.JsonProperty; - -/** The properties of the product to initiate a transfer. */ -@Fluent -public final class TransferProductRequestProperties { - /* - * The destination invoice section id. - */ - @JsonProperty(value = "destinationInvoiceSectionId") - private String destinationInvoiceSectionId; - - /** Creates an instance of TransferProductRequestProperties class. */ - public TransferProductRequestProperties() { - } - - /** - * 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 05141ea1bff9..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.fasterxml.jackson.annotation.JsonProperty; - -/** Error details of the product transfer eligibility validation. */ -@Fluent -public final class ValidateProductTransferEligibilityError { - /* - * 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; - - /** Creates an instance of ValidateProductTransferEligibilityError class. */ - public ValidateProductTransferEligibilityError() { - } - - /** - * 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 d7fa61fceaa0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ValidateSubscriptionTransferEligibilityError.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.fasterxml.jackson.annotation.JsonProperty; - -/** Error details of the transfer eligibility validation. */ -@Fluent -public final class ValidateSubscriptionTransferEligibilityError { - /* - * 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; - - /** Creates an instance of ValidateSubscriptionTransferEligibilityError class. */ - public ValidateSubscriptionTransferEligibilityError() { - } - - /** - * 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 1726df6a104f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ViewCharges.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. */ -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 a new instance of ViewCharges value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ViewCharges() { - } - - /** - * 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); - } - - /** - * Gets known ViewCharges values. - * - * @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 d2c2047c52dd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/ViewChargesPolicy.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The policy that controls whether users with Azure RBAC access to a subscription can view its charges. */ -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 a new instance of ViewChargesPolicy value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ViewChargesPolicy() { - } - - /** - * 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); - } - - /** - * Gets known ViewChargesPolicy values. - * - * @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 a85bfdbed075..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AddressValidateSamples.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.generated; - -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("fakeTokenPlaceholder"), - com.azure.core.util.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("fakeTokenPlaceholder"), - com.azure.core.util.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 0e47789c27ab..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; - -/** 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, com.azure.core.util.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 fc4be17de702..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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, com.azure.core.util.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 b2c36890b574..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; - -/** 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}", com.azure.core.util.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 2931b35323d6..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; - -/** 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", - com.azure.core.util.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, com.azure.core.util.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 c0949ee719f4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListInvoiceSectionsByCreateSubscriptionPermissionSamples.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; - -/** 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}", com.azure.core.util.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 b928c56edfcc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsListSamples.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; - -/** 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, com.azure.core.util.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", com.azure.core.util.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", com.azure.core.util.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 a8bc12b67ee2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingAccountsUpdateSamples.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.generated; - -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("fakeTokenPlaceholder")), - com.azure.core.util.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 a8eeef3411e6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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", com.azure.core.util.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 fe074f624dfb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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, com.azure.core.util.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 749219927b8a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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}", com.azure.core.util.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 9c700744f8d1..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; - -/** 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}", com.azure.core.util.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 47ecb819e6c3..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; - -/** 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}", com.azure.core.util.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 375cf59b6cf2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsSamples.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; - -/** 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}", - com.azure.core.util.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 945ebcfb4389..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesCreateOrUpdateSamples.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.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("fakeTokenPlaceholder")) - .withInvoiceEmailOptIn(true) - .withEnabledAzurePlans( - Arrays.asList(new AzurePlan().withSkuId("0001"), new AzurePlan().withSkuId("0002"))), - com.azure.core.util.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 0ee57263e0e5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingProfilesGetSamples.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; - -/** 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", com.azure.core.util.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, com.azure.core.util.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 3dd1368def39..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; - -/** 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", com.azure.core.util.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, com.azure.core.util.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 2d42a03f854f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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(com.azure.core.util.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 7fa915bdf301..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingPropertyUpdateSamples.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.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"), com.azure.core.util.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 e58ac66809b4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountSamples.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; - -/** 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}", com.azure.core.util.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 1233799c36c3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileSamples.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; - -/** 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}", - com.azure.core.util.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 ffed5ad0544d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionSamples.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; - -/** 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}", - com.azure.core.util.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 ddb4c2218172..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountSamples.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; - -/** 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}", com.azure.core.util.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 510dc1711830..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileSamples.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; - -/** 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}", - com.azure.core.util.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 59207d8350b2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionSamples.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; - -/** 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}", - com.azure.core.util.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 1a2fee1fb595..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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}", com.azure.core.util.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 1b1fb83d0ee8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileSamples.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; - -/** 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}", com.azure.core.util.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 5deba09f7487..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionSamples.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; - -/** 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}", - com.azure.core.util.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 fb5ce1213d06..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountSamples.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; - -/** 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}", com.azure.core.util.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 c1c38629a923..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileSamples.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; - -/** 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}", - com.azure.core.util.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 49afb6680f4f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionSamples.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; - -/** 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}", - com.azure.core.util.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 e885d49b3d84..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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}", com.azure.core.util.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 4b309b01b180..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileSamples.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; - -/** 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}", com.azure.core.util.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 a00a74ebb81d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionSamples.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; - -/** 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}", - com.azure.core.util.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 162f315126b7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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}", com.azure.core.util.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 a17560829e65..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (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; - -/** 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}", com.azure.core.util.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 55dea15e35d4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileSamples.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; - -/** 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}", com.azure.core.util.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 e841064075b6..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; - -/** 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}", com.azure.core.util.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 a67ea15b6760..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionSamples.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; - -/** 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}", - com.azure.core.util.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 3892c08e03d7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveSamples.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.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}"), - com.azure.core.util.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 e55a3d34ba98..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateSamples.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.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"), - com.azure.core.util.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 bd1daa62cbea..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsValidateMoveSamples.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (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.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}"), - com.azure.core.util.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}"), - com.azure.core.util.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 52e85bf5d603..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersGetSamples.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; - -/** 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", - com.azure.core.util.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, com.azure.core.util.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 15cd3c3593da..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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, com.azure.core.util.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 88f504d26bc4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileSamples.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; - -/** 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, com.azure.core.util.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 3036ac4867da..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; - -/** 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", com.azure.core.util.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 ac3aba88167c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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(com.azure.core.util.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 f880c2ee1880..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsGetSamples.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; - -/** 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}", com.azure.core.util.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 035d20c24f17..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; - -/** 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}", com.azure.core.util.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 32582dfad522..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InstructionsPutSamples.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.generated; - -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")), - com.azure.core.util.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 854b6b370fd8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.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.generated; - -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")), - com.azure.core.util.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 065b3593969e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetSamples.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; - -/** 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}", - com.azure.core.util.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 f8dc780b0296..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; - -/** 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}", com.azure.core.util.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 a2b6c40ec013..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; - -/** 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", com.azure.core.util.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 6925a5b77cbf..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; - -/** 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", com.azure.core.util.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 14f62f95826e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesSamples.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 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"), - com.azure.core.util.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 73caf27d94f7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesSamples.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 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"), - com.azure.core.util.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 9e8739aed396..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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}", com.azure.core.util.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 dadef8d4ffe0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (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; - -/** 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}", com.azure.core.util.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 f97b3ad93c77..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesGetSamples.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.generated; - -/** 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}", com.azure.core.util.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}", com.azure.core.util.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}", com.azure.core.util.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}", com.azure.core.util.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 a6a7fb572c21..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountSamples.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; - -/** 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", com.azure.core.util.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", com.azure.core.util.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 63a25b26023d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileSamples.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; - -/** 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", - com.azure.core.util.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", - com.azure.core.util.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 63ffc552facc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (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; - -/** 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("2022-01-01", "2022-06-30", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/OperationsListSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/OperationsListSamples.java deleted file mode 100644 index 695d94af736f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/OperationsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** Samples for Operations List. */ -public final class OperationsListSamples { - /* - * x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/GetOperations.json - */ - /** - * Sample code: BillingAccountPermissionsList. - * - * @param manager Entry point to BillingManager. - */ - public static void billingAccountPermissionsList(com.azure.resourcemanager.billing.BillingManager manager) { - manager.operations().list(com.azure.core.util.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 0f353855b128..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileSamples.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; - -/** 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}", com.azure.core.util.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 fc4161b1502b..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; - -/** 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}", com.azure.core.util.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 6b56cc40b3be..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerSamples.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.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), - com.azure.core.util.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 5802fe720763..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateSamples.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.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), - com.azure.core.util.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 359bef2f46a9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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}", com.azure.core.util.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 3546c1d56d52..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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, com.azure.core.util.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 5819148d0087..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileSamples.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; - -/** 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, com.azure.core.util.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 48ffc2532815..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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}", com.azure.core.util.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 88f7682f8e86..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionSamples.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; - -/** 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, - com.azure.core.util.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 8507391eee45..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsMoveSamples.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.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}"), - com.azure.core.util.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 06f0938148c1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsUpdateSamples.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.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), - com.azure.core.util.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 57017d82538a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ProductsValidateMoveSamples.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.generated; - -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}"), - com.azure.core.util.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}"), - com.azure.core.util.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 4027aed30f87..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (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; - -/** 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", - com.azure.core.util.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 6b2f3800edd2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileSamples.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; - -/** 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", - com.azure.core.util.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 1e1dc8beed0f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (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; - -/** 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}", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.java deleted file mode 100644 index 1f7b74ba75ee..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AgreementInner; -import com.azure.resourcemanager.billing.models.Participants; -import java.util.Arrays; - -public final class AgreementInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgreementInner model = - BinaryData - .fromString( - "{\"properties\":{\"agreementLink\":\"goo\",\"category\":\"Other\",\"acceptanceMode\":\"ClickToAccept\",\"billingProfileInfo\":{\"billingProfileId\":\"bvleorfmluiqtqzf\",\"billingProfileDisplayName\":\"yvnqqybaryeuay\",\"indirectRelationshipOrganizationName\":\"qabqgzslesjcb\"},\"effectiveDate\":\"2021-02-16T20:00:10Z\",\"expirationDate\":\"2021-04-10T08:53:01Z\",\"participants\":[{\"status\":\"w\",\"statusDate\":\"2021-08-27T00:56:15Z\",\"email\":\"bquwrbehw\"}],\"status\":\"o\"},\"id\":\"buffkmrqemvvhm\",\"name\":\"tdrjfutacoebj\",\"type\":\"ewzcjznmwcp\"}") - .toObject(AgreementInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgreementInner model = new AgreementInner().withParticipants(Arrays.asList(new Participants())); - model = BinaryData.fromObject(model).toObject(AgreementInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.java deleted file mode 100644 index 8a6c59713bfb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.AgreementListResult; - -public final class AgreementListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgreementListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"agreementLink\":\"ibthostgktstvd\",\"category\":\"MicrosoftCustomerAgreement\",\"acceptanceMode\":\"ESignEmbedded\",\"effectiveDate\":\"2021-03-03T03:15:27Z\",\"expirationDate\":\"2021-06-23T00:26:33Z\",\"participants\":[],\"status\":\"zlhp\"},\"id\":\"odqkdlwwqfb\",\"name\":\"mlkxtrqjfs\",\"type\":\"lmbtxhwgfwsrt\"}],\"nextLink\":\"coezbrhubskh\"}") - .toObject(AgreementListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgreementListResult model = new AgreementListResult(); - model = BinaryData.fromObject(model).toObject(AgreementListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.java deleted file mode 100644 index 95388707ed2c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AgreementProperties; -import com.azure.resourcemanager.billing.models.Participants; -import java.util.Arrays; - -public final class AgreementPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgreementProperties model = - BinaryData - .fromString( - "{\"agreementLink\":\"uaadraufactkahzo\",\"category\":\"MicrosoftCustomerAgreement\",\"acceptanceMode\":\"ESignOffline\",\"billingProfileInfo\":{\"billingProfileId\":\"xxpshneeku\",\"billingProfileDisplayName\":\"gs\",\"indirectRelationshipOrganizationName\":\"ubkwdle\"},\"effectiveDate\":\"2021-04-28T05:58:57Z\",\"expirationDate\":\"2021-04-26T16:34:12Z\",\"participants\":[{\"status\":\"bazpjuohmi\",\"statusDate\":\"2021-09-21T23:44:56Z\",\"email\":\"norwmduvwpklvx\"},{\"status\":\"ygdxpgpqchis\",\"statusDate\":\"2021-05-26T11:43:30Z\",\"email\":\"nb\"},{\"status\":\"rxgibbd\",\"statusDate\":\"2021-01-14T17:21:41Z\",\"email\":\"nfo\"},{\"status\":\"uors\",\"statusDate\":\"2021-10-18T05:02:18Z\",\"email\":\"wbqpl\"}],\"status\":\"vnuuepzl\"}") - .toObject(AgreementProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgreementProperties model = - new AgreementProperties() - .withParticipants( - Arrays.asList(new Participants(), new Participants(), new Participants(), new Participants())); - model = BinaryData.fromObject(model).toObject(AgreementProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java deleted file mode 100644 index 624664dfc592..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Agreement; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AgreementsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"agreementLink\":\"eaoqaqbzgyhf\",\"category\":\"Other\",\"acceptanceMode\":\"ClickToAccept\",\"billingProfileInfo\":{\"billingProfileId\":\"wbqamteuliy\",\"billingProfileDisplayName\":\"pkcvmwf\",\"indirectRelationshipOrganizationName\":\"xxe\"},\"effectiveDate\":\"2021-08-01T10:31:28Z\",\"expirationDate\":\"2021-11-27T08:01:10Z\",\"participants\":[],\"status\":\"c\"},\"id\":\"miciij\",\"name\":\"pkzfbojxj\",\"type\":\"cs\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Agreement response = - manager.agreements().getWithResponse("zjd", "r", "jb", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.java deleted file mode 100644 index 6597fe543582..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Agreement; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AgreementsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"agreementLink\":\"gttmvmmagoaqyl\",\"category\":\"MicrosoftCustomerAgreement\",\"acceptanceMode\":\"ClickToAccept\",\"billingProfileInfo\":{\"billingProfileId\":\"azjcgmxitpfin\",\"billingProfileDisplayName\":\"pdltkrlg\",\"indirectRelationshipOrganizationName\":\"tbdrvcqgue\"},\"effectiveDate\":\"2021-05-18T02:25:41Z\",\"expirationDate\":\"2021-08-13T12:33:46Z\",\"participants\":[],\"status\":\"qdurelyujlfyoum\"},\"id\":\"ckyeclcdigpta\",\"name\":\"brzmqxucycijoclx\",\"type\":\"utgjcyz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.agreements().listByBillingAccount("aderzmw", "t", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.java deleted file mode 100644 index e5b9eef51ad9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.Amount; -import org.junit.jupiter.api.Assertions; - -public final class AmountTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Amount model = BinaryData.fromString("{\"currency\":\"rbpizc\",\"value\":87.63677}").toObject(Amount.class); - Assertions.assertEquals(87.63677F, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Amount model = new Amount().withValue(87.63677F); - model = BinaryData.fromObject(model).toObject(Amount.class); - Assertions.assertEquals(87.63677F, model.value()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.java deleted file mode 100644 index 7484a233d57c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner; - -public final class AvailableBalanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableBalanceInner model = - BinaryData - .fromString( - "{\"properties\":{\"amount\":{\"currency\":\"kouknvudwtiu\",\"value\":51.070255}},\"id\":\"dng\",\"name\":\"pocipazyxoegu\",\"type\":\"g\"}") - .toObject(AvailableBalanceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableBalanceInner model = new AvailableBalanceInner(); - model = BinaryData.fromObject(model).toObject(AvailableBalanceInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.java deleted file mode 100644 index fdffcb712d86..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceProperties; - -public final class AvailableBalancePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableBalanceProperties model = - BinaryData - .fromString("{\"amount\":{\"currency\":\"iucgygevqzn\",\"value\":13.069307}}") - .toObject(AvailableBalanceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableBalanceProperties model = new AvailableBalanceProperties(); - model = BinaryData.fromObject(model).toObject(AvailableBalanceProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java deleted file mode 100644 index cd3761316bd0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AvailableBalance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AvailableBalancesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"amount\":{\"currency\":\"x\",\"value\":73.497665}},\"id\":\"lc\",\"name\":\"xwmdboxd\",\"type\":\"gsftufqobrjlnacg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AvailableBalance response = - manager.availableBalances().getWithResponse("es", "kdlpa", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.java deleted file mode 100644 index 1a38d2eb37a2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.AzurePlan; -import org.junit.jupiter.api.Assertions; - -public final class AzurePlanTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzurePlan model = - BinaryData.fromString("{\"skuId\":\"hocdgeab\",\"skuDescription\":\"phut\"}").toObject(AzurePlan.class); - Assertions.assertEquals("hocdgeab", model.skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzurePlan model = new AzurePlan().withSkuId("hocdgeab"); - model = BinaryData.fromObject(model).toObject(AzurePlan.class); - Assertions.assertEquals("hocdgeab", model.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.java deleted file mode 100644 index a0963b249e06..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.BillingAccountListResult; - -public final class BillingAccountListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingAccountListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"uv\",\"agreementType\":\"MicrosoftPartnerAgreement\",\"accountType\":\"Individual\",\"accountStatus\":\"Extended\",\"departments\":[],\"enrollmentAccounts\":[],\"hasReadAccess\":true,\"notificationEmailAddress\":\"pbsphrupidgs\"},\"id\":\"bb\",\"name\":\"jhphoyc\",\"type\":\"sx\"},{\"properties\":{\"displayName\":\"hdxbmtqio\",\"agreementType\":\"EnterpriseAgreement\",\"accountType\":\"Individual\",\"accountStatus\":\"Expired\",\"departments\":[],\"enrollmentAccounts\":[],\"hasReadAccess\":false,\"notificationEmailAddress\":\"izhwlrxy\"},\"id\":\"qsoqijgkd\",\"name\":\"bpazlobcufpdzn\",\"type\":\"btcqq\"},{\"properties\":{\"displayName\":\"glhqg\",\"agreementType\":\"MicrosoftOnlineServicesProgram\",\"accountType\":\"Individual\",\"accountStatus\":\"Active\",\"departments\":[],\"enrollmentAccounts\":[],\"hasReadAccess\":false,\"notificationEmailAddress\":\"aagdfmg\"},\"id\":\"zlhjxrifkwmrvkt\",\"name\":\"izntocipao\",\"type\":\"ajpsquc\"}],\"nextLink\":\"o\"}") - .toObject(BillingAccountListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingAccountListResult model = new BillingAccountListResult(); - model = BinaryData.fromObject(model).toObject(BillingAccountListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.java deleted file mode 100644 index 6ec0e98a459d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; - -public final class BillingPeriodInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPeriodInner model = - BinaryData - .fromString( - "{\"properties\":{\"invoiceIds\":[\"ctxmwoteyowcluq\",\"vekqvgqo\",\"wifzmp\",\"wyivqikf\"]},\"id\":\"cvhrfsp\",\"name\":\"uagrttikteusqc\",\"type\":\"kvyklxubyjaffmm\"}") - .toObject(BillingPeriodInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPeriodInner model = new BillingPeriodInner(); - model = BinaryData.fromObject(model).toObject(BillingPeriodInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.java deleted file mode 100644 index 25cc3a72d9fd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodProperties; - -public final class BillingPeriodPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPeriodProperties model = - BinaryData - .fromString("{\"invoiceIds\":[\"cuubgq\",\"brta\",\"metttwgd\"]}") - .toObject(BillingPeriodProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPeriodProperties model = new BillingPeriodProperties(); - model = BinaryData.fromObject(model).toObject(BillingPeriodProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java deleted file mode 100644 index f0f0d4b7a996..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPeriod; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPeriodsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"invoiceIds\":[\"inic\",\"teajohiyg\"]},\"id\":\"pnbonhpcz\",\"name\":\"kmktpvwxqcseh\",\"type\":\"hkhufm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingPeriod response = - manager.billingPeriods().getWithResponse("wugiqjti", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.java deleted file mode 100644 index b17ab4dbac9e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPeriod; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPeriodsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"invoiceIds\":[\"qlnfw\",\"y\",\"mvqdbpbhfckdvez\",\"rcssbzhddubbnq\"]},\"id\":\"b\",\"name\":\"h\",\"type\":\"alehpav\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPeriods().list("jreuykbbmn", "aglt", 608268235, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.java deleted file mode 100644 index 59c70858829a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.BillingPeriodsListResult; - -public final class BillingPeriodsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPeriodsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"invoiceIds\":[]},\"id\":\"lcwkhihihlhz\",\"name\":\"sqtzbsrg\",\"type\":\"o\"}],\"nextLink\":\"jhf\"}") - .toObject(BillingPeriodsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPeriodsListResult model = new BillingPeriodsListResult(); - model = BinaryData.fromObject(model).toObject(BillingPeriodsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.java deleted file mode 100644 index 9b943318962a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"juj\",\"ickpz\",\"cpopmxel\",\"wcltyjede\"],\"notActions\":[\"lfmk\",\"scazuawxtzxpu\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPermissions().listByBillingAccount("zhraglkafh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.java deleted file mode 100644 index 9710e57cb536..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"upeujlzqnhcvsq\"],\"notActions\":[\"zoibgsxg\",\"xfyqonmpqoxwdo\",\"dbxiqx\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPermissions().listByBillingProfile("zcbmqqvxmvwf", "tayx", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.java deleted file mode 100644 index 78f4e5c013a1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByCustomerMockTests { - @Test - public void testListByCustomer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"zkzobgopxlhslnel\",\"ieixynllxe\"],\"notActions\":[\"rojphslhcawjutif\",\"wfmvigorqjbt\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPermissions().listByCustomer("dsxwaab", "mifrygznmma", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.java deleted file mode 100644 index 4b5879673099..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByInvoiceSectionsMockTests { - @Test - public void testListByInvoiceSections() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"wywa\",\"oi\"],\"notActions\":[\"smjblmljhlnym\",\"otqyry\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingPermissions() - .listByInvoiceSections("mwabzxrvxc", "s", "sphaivmxyasflvg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.java deleted file mode 100644 index fcdd9386574f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.BillingPermissionsListResult; - -public final class BillingPermissionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPermissionsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"actions\":[\"kphywpnvjto\",\"nermcl\",\"plpho\",\"uscrpabgyepsb\"],\"notActions\":[\"zq\",\"gxywpmue\",\"fjz\",\"fqkquj\"]}],\"nextLink\":\"suyonobglaocq\"}") - .toObject(BillingPermissionsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPermissionsListResult model = new BillingPermissionsListResult(); - model = BinaryData.fromObject(model).toObject(BillingPermissionsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.java deleted file mode 100644 index 21fc66c4098c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; - -public final class BillingPermissionsPropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPermissionsPropertiesInner model = - BinaryData - .fromString("{\"actions\":[\"cmgyud\"],\"notActions\":[\"lmoyrx\",\"wfudwpzntxhdzhl\"]}") - .toObject(BillingPermissionsPropertiesInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPermissionsPropertiesInner model = new BillingPermissionsPropertiesInner(); - model = BinaryData.fromObject(model).toObject(BillingPermissionsPropertiesInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.java deleted file mode 100644 index 74af700e4d95..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.BillingProfileInfo; -import org.junit.jupiter.api.Assertions; - -public final class BillingProfileInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingProfileInfo model = - BinaryData - .fromString( - "{\"billingProfileId\":\"hw\",\"billingProfileDisplayName\":\"oldweyuqdu\",\"indirectRelationshipOrganizationName\":\"mnnrwr\"}") - .toObject(BillingProfileInfo.class); - Assertions.assertEquals("hw", model.billingProfileId()); - Assertions.assertEquals("oldweyuqdu", model.billingProfileDisplayName()); - Assertions.assertEquals("mnnrwr", model.indirectRelationshipOrganizationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingProfileInfo model = - new BillingProfileInfo() - .withBillingProfileId("hw") - .withBillingProfileDisplayName("oldweyuqdu") - .withIndirectRelationshipOrganizationName("mnnrwr"); - model = BinaryData.fromObject(model).toObject(BillingProfileInfo.class); - Assertions.assertEquals("hw", model.billingProfileId()); - Assertions.assertEquals("oldweyuqdu", model.billingProfileDisplayName()); - Assertions.assertEquals("mnnrwr", model.indirectRelationshipOrganizationName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java deleted file mode 100644 index fded7fada716..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; -import org.junit.jupiter.api.Assertions; - -public final class BillingRoleAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleAssignmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"createdOn\":\"ithtywu\",\"createdByPrincipalTenantId\":\"cbihwqk\",\"createdByPrincipalId\":\"dntwjchrdgo\",\"createdByUserEmailAddress\":\"xum\",\"principalId\":\"ton\",\"principalTenantId\":\"jl\",\"roleDefinitionId\":\"dfdlwggyts\",\"scope\":\"tov\",\"userAuthenticationType\":\"gseinq\",\"userEmailAddress\":\"ufxqknpirgnepttw\"},\"id\":\"msniffc\",\"name\":\"mqnrojlpijnkr\",\"type\":\"frddhcrati\"}") - .toObject(BillingRoleAssignmentInner.class); - Assertions.assertEquals("ton", model.principalId()); - Assertions.assertEquals("jl", model.principalTenantId()); - Assertions.assertEquals("dfdlwggyts", model.roleDefinitionId()); - Assertions.assertEquals("gseinq", model.userAuthenticationType()); - Assertions.assertEquals("ufxqknpirgnepttw", model.userEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleAssignmentInner model = - new BillingRoleAssignmentInner() - .withPrincipalId("ton") - .withPrincipalTenantId("jl") - .withRoleDefinitionId("dfdlwggyts") - .withUserAuthenticationType("gseinq") - .withUserEmailAddress("ufxqknpirgnepttw"); - model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentInner.class); - Assertions.assertEquals("ton", model.principalId()); - Assertions.assertEquals("jl", model.principalTenantId()); - Assertions.assertEquals("dfdlwggyts", model.roleDefinitionId()); - Assertions.assertEquals("gseinq", model.userAuthenticationType()); - Assertions.assertEquals("ufxqknpirgnepttw", model.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.java deleted file mode 100644 index a511766746b1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.BillingRoleAssignmentListResult; - -public final class BillingRoleAssignmentListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleAssignmentListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"createdOn\":\"gikyzirtx\",\"createdByPrincipalTenantId\":\"uxzejntpsew\",\"createdByPrincipalId\":\"oi\",\"createdByUserEmailAddress\":\"ukry\",\"principalId\":\"tqmieox\",\"principalTenantId\":\"ggufhyaomtb\",\"roleDefinitionId\":\"havgrvk\",\"scope\":\"ovjzhpjbibgjmfx\",\"userAuthenticationType\":\"vfcluyovwxnbkfe\",\"userEmailAddress\":\"xscyhwzdgirujbz\"},\"id\":\"omvzzbtd\",\"name\":\"qvpn\",\"type\":\"yujviylwdshfssn\"},{\"properties\":{\"createdOn\":\"ye\",\"createdByPrincipalTenantId\":\"ymsgaojfmwnc\",\"createdByPrincipalId\":\"mrfhirctymox\",\"createdByUserEmailAddress\":\"tpipiwyczuhx\",\"principalId\":\"pqjlihhyusps\",\"principalTenantId\":\"sdvlmfwdgzxulucv\",\"roleDefinitionId\":\"mrsreuzvxurisjnh\",\"scope\":\"txifqj\",\"userAuthenticationType\":\"xmrhu\",\"userEmailAddress\":\"wp\"},\"id\":\"esutrgjupauutpw\",\"name\":\"qhih\",\"type\":\"jqgwzp\"},{\"properties\":{\"createdOn\":\"n\",\"createdByPrincipalTenantId\":\"ypsxjvfoim\",\"createdByPrincipalId\":\"slirciz\",\"createdByUserEmailAddress\":\"vydfceacvlhvygdy\",\"principalId\":\"umrtwnawjsl\",\"principalTenantId\":\"wkojgcyztsfmzn\",\"roleDefinitionId\":\"eqphchqnrnr\",\"scope\":\"ehuwrykqgaifmvik\",\"userAuthenticationType\":\"ydv\",\"userEmailAddress\":\"bejdznxcv\"},\"id\":\"srhnjivo\",\"name\":\"v\",\"type\":\"novqfzge\"},{\"properties\":{\"createdOn\":\"ftul\",\"createdByPrincipalTenantId\":\"tduceamt\",\"createdByPrincipalId\":\"zuo\",\"createdByUserEmailAddress\":\"jw\",\"principalId\":\"wqiok\",\"principalTenantId\":\"sx\",\"roleDefinitionId\":\"jmsvpkjp\",\"scope\":\"kwcf\",\"userAuthenticationType\":\"ljyxgtczhe\",\"userEmailAddress\":\"bsdshmkxmaehvbbx\"},\"id\":\"ripltf\",\"name\":\"htba\",\"type\":\"kgxywr\"}],\"nextLink\":\"pyklyhpluodpvru\"}") - .toObject(BillingRoleAssignmentListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleAssignmentListResult model = new BillingRoleAssignmentListResult(); - model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java deleted file mode 100644 index 1e32f048ccb4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentProperties; -import org.junit.jupiter.api.Assertions; - -public final class BillingRoleAssignmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleAssignmentProperties model = - BinaryData - .fromString( - "{\"createdOn\":\"ronasxift\",\"createdByPrincipalTenantId\":\"qyzhf\",\"createdByPrincipalId\":\"esgogc\",\"createdByUserEmailAddress\":\"onnxkrlgnyhm\",\"principalId\":\"sxkkg\",\"principalTenantId\":\"rrghxjbdhqxvcxgf\",\"roleDefinitionId\":\"dsofbshrns\",\"scope\":\"uswdv\",\"userAuthenticationType\":\"ybycnunvj\",\"userEmailAddress\":\"tkfa\"}") - .toObject(BillingRoleAssignmentProperties.class); - Assertions.assertEquals("sxkkg", model.principalId()); - Assertions.assertEquals("rrghxjbdhqxvcxgf", model.principalTenantId()); - Assertions.assertEquals("dsofbshrns", model.roleDefinitionId()); - Assertions.assertEquals("ybycnunvj", model.userAuthenticationType()); - Assertions.assertEquals("tkfa", model.userEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleAssignmentProperties model = - new BillingRoleAssignmentProperties() - .withPrincipalId("sxkkg") - .withPrincipalTenantId("rrghxjbdhqxvcxgf") - .withRoleDefinitionId("dsofbshrns") - .withUserAuthenticationType("ybycnunvj") - .withUserEmailAddress("tkfa"); - model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentProperties.class); - Assertions.assertEquals("sxkkg", model.principalId()); - Assertions.assertEquals("rrghxjbdhqxvcxgf", model.principalTenantId()); - Assertions.assertEquals("dsofbshrns", model.roleDefinitionId()); - Assertions.assertEquals("ybycnunvj", model.userAuthenticationType()); - Assertions.assertEquals("tkfa", model.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.java deleted file mode 100644 index 18b71c4483e6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests { - @Test - public void testDeleteByBillingAccountWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"jmvqmtd\",\"createdByPrincipalTenantId\":\"kygroejnndljdj\",\"createdByPrincipalId\":\"kb\",\"createdByUserEmailAddress\":\"eqy\",\"principalId\":\"ceysfaqeg\",\"principalTenantId\":\"wryshwd\",\"roleDefinitionId\":\"vbxgkqusyb\",\"scope\":\"tdacarvvlfn\",\"userAuthenticationType\":\"mt\",\"userEmailAddress\":\"iwenazero\"},\"id\":\"zrsq\",\"name\":\"lsxkd\",\"type\":\"wqapfgsdp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .deleteByBillingAccountWithResponse("zcbyfq", "kfaoytehq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ceysfaqeg", response.principalId()); - Assertions.assertEquals("wryshwd", response.principalTenantId()); - Assertions.assertEquals("vbxgkqusyb", response.roleDefinitionId()); - Assertions.assertEquals("mt", response.userAuthenticationType()); - Assertions.assertEquals("iwenazero", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java deleted file mode 100644 index 40f4f3b7af32..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests { - @Test - public void testDeleteByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"mtggmu\",\"createdByPrincipalTenantId\":\"ch\",\"createdByPrincipalId\":\"fnkf\",\"createdByUserEmailAddress\":\"lv\",\"principalId\":\"oakizvoai\",\"principalTenantId\":\"a\",\"roleDefinitionId\":\"nuwiguyxlykwph\",\"scope\":\"zc\",\"userAuthenticationType\":\"hmpejtlkexaonw\",\"userEmailAddress\":\"kcq\"},\"id\":\"rxhxkn\",\"name\":\"ccrmmk\",\"type\":\"upijubyqjfkakfq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .deleteByBillingProfileWithResponse( - "pqigtuujwouhd", "wsigrbjbxsj", "bvitvqkjya", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("oakizvoai", response.principalId()); - Assertions.assertEquals("a", response.principalTenantId()); - Assertions.assertEquals("nuwiguyxlykwph", response.roleDefinitionId()); - Assertions.assertEquals("hmpejtlkexaonw", response.userAuthenticationType()); - Assertions.assertEquals("kcq", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java deleted file mode 100644 index d3e7fb23ab8c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests { - @Test - public void testDeleteByInvoiceSectionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"kpeeksnbksdqhj\",\"createdByPrincipalTenantId\":\"klxesl\",\"createdByPrincipalId\":\"hustcpoqmavnwqjw\",\"createdByUserEmailAddress\":\"knlejjjkxybwfd\",\"principalId\":\"jbzten\",\"principalTenantId\":\"kzykjtjk\",\"roleDefinitionId\":\"xfwush\",\"scope\":\"pkupnq\",\"userAuthenticationType\":\"gjfbpkuwxeoi\",\"userEmailAddress\":\"fiz\"},\"id\":\"av\",\"name\":\"jzwfb\",\"type\":\"yay\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .deleteByInvoiceSectionWithResponse( - "jsaqwotmmwllcols", "sxap", "efh", "xcgjokjljnhvlq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("jbzten", response.principalId()); - Assertions.assertEquals("kzykjtjk", response.principalTenantId()); - Assertions.assertEquals("xfwush", response.roleDefinitionId()); - Assertions.assertEquals("gjfbpkuwxeoi", response.userAuthenticationType()); - Assertions.assertEquals("fiz", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.java deleted file mode 100644 index a34cf3a681c1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests { - @Test - public void testGetByBillingAccountWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"tptnuwjtk\",\"createdByPrincipalTenantId\":\"h\",\"createdByPrincipalId\":\"gqy\",\"createdByUserEmailAddress\":\"eseyqr\",\"principalId\":\"y\",\"principalTenantId\":\"dotjvdk\",\"roleDefinitionId\":\"swskuk\",\"scope\":\"asbvw\",\"userAuthenticationType\":\"pkxkdtxfk\",\"userEmailAddress\":\"lq\"},\"id\":\"twknvgm\",\"name\":\"bugtywatmqa\",\"type\":\"kueatgroeshoy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .getByBillingAccountWithResponse("zffovwmbjl", "qsczpgvdwnapfdqw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("y", response.principalId()); - Assertions.assertEquals("dotjvdk", response.principalTenantId()); - Assertions.assertEquals("swskuk", response.roleDefinitionId()); - Assertions.assertEquals("pkxkdtxfk", response.userAuthenticationType()); - Assertions.assertEquals("lq", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.java deleted file mode 100644 index cd442c83b265..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests { - @Test - public void testGetByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"wsrsxkrplbja\",\"createdByPrincipalTenantId\":\"jwwviy\",\"createdByPrincipalId\":\"ps\",\"createdByUserEmailAddress\":\"brnnhjxsqw\",\"principalId\":\"qkbiwet\",\"principalTenantId\":\"zycyqiqyhg\",\"roleDefinitionId\":\"etzlexbsfledynoj\",\"scope\":\"iuwfbzkkdtnhqsy\",\"userAuthenticationType\":\"jselpkpbafvafh\",\"userEmailAddress\":\"ylcc\"},\"id\":\"evxrhyz\",\"name\":\"fwrsofpltdbmair\",\"type\":\"hvhfnracw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .getByBillingProfileWithResponse("mmfz", "bfw", "rzx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qkbiwet", response.principalId()); - Assertions.assertEquals("zycyqiqyhg", response.principalTenantId()); - Assertions.assertEquals("etzlexbsfledynoj", response.roleDefinitionId()); - Assertions.assertEquals("jselpkpbafvafh", response.userAuthenticationType()); - Assertions.assertEquals("ylcc", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.java deleted file mode 100644 index e8c9979996e1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests { - @Test - public void testGetByInvoiceSectionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"htjqvqyvw\",\"createdByPrincipalTenantId\":\"tae\",\"createdByPrincipalId\":\"hzzysevusxiv\",\"createdByUserEmailAddress\":\"rryveimipskdy\",\"principalId\":\"tv\",\"principalTenantId\":\"zkaftjvvrux\",\"roleDefinitionId\":\"gsyeipqdsmjtg\",\"scope\":\"gdgkki\",\"userAuthenticationType\":\"plkcsm\",\"userEmailAddress\":\"hwtbbaedorvvm\"},\"id\":\"floygbdgwumg\",\"name\":\"dgdhpabgdexj\",\"type\":\"d\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .getByInvoiceSectionWithResponse("vessm", "hhkuuip", "dqq", "tekva", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("tv", response.principalId()); - Assertions.assertEquals("zkaftjvvrux", response.principalTenantId()); - Assertions.assertEquals("gsyeipqdsmjtg", response.roleDefinitionId()); - Assertions.assertEquals("plkcsm", response.userAuthenticationType()); - Assertions.assertEquals("hwtbbaedorvvm", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.java deleted file mode 100644 index acd69f58f245..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdOn\":\"ldudxjascowv\",\"createdByPrincipalTenantId\":\"jkpdxphlkksnm\",\"createdByPrincipalId\":\"vyfijdkzuqnw\",\"createdByUserEmailAddress\":\"thuqolyahluq\",\"principalId\":\"ulsutrjbhxy\",\"principalTenantId\":\"hyqezvqq\",\"roleDefinitionId\":\"drftbcvexreuquo\",\"scope\":\"ljvfwhreagk\",\"userAuthenticationType\":\"xv\",\"userEmailAddress\":\"tvbczsulm\"},\"id\":\"gglmepjpfsey\",\"name\":\"g\",\"type\":\"angpszngafpgyl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingRoleAssignments().listByBillingAccount("rke", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ulsutrjbhxy", response.iterator().next().principalId()); - Assertions.assertEquals("hyqezvqq", response.iterator().next().principalTenantId()); - Assertions.assertEquals("drftbcvexreuquo", response.iterator().next().roleDefinitionId()); - Assertions.assertEquals("xv", response.iterator().next().userAuthenticationType()); - Assertions.assertEquals("tvbczsulm", response.iterator().next().userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.java deleted file mode 100644 index 4972f2e26b11..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdOn\":\"iilialwc\",\"createdByPrincipalTenantId\":\"ckbbcc\",\"createdByPrincipalId\":\"zpraoxn\",\"createdByUserEmailAddress\":\"ffatsgftipw\",\"principalId\":\"byubhiqdxyurnpn\",\"principalTenantId\":\"zafccnuhiigb\",\"roleDefinitionId\":\"bui\",\"scope\":\"xvatvcr\",\"userAuthenticationType\":\"lbnb\",\"userEmailAddress\":\"vhcs\"},\"id\":\"hzlwxaea\",\"name\":\"vurex\",\"type\":\"ndsbdw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingRoleAssignments().listByBillingProfile("erppt", "bgqnz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("byubhiqdxyurnpn", response.iterator().next().principalId()); - Assertions.assertEquals("zafccnuhiigb", response.iterator().next().principalTenantId()); - Assertions.assertEquals("bui", response.iterator().next().roleDefinitionId()); - Assertions.assertEquals("lbnb", response.iterator().next().userAuthenticationType()); - Assertions.assertEquals("vhcs", response.iterator().next().userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.java deleted file mode 100644 index fb6464e73fd0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdOn\":\"jfoknubnoitpkp\",\"createdByPrincipalTenantId\":\"rgdg\",\"createdByPrincipalId\":\"coqra\",\"createdByUserEmailAddress\":\"ugyxpqit\",\"principalId\":\"ialwv\",\"principalTenantId\":\"buhzacaq\",\"roleDefinitionId\":\"ltcoqc\",\"scope\":\"pdsxzakuejkm\",\"userAuthenticationType\":\"iztjof\",\"userEmailAddress\":\"vovjufycsjmlbe\"},\"id\":\"yeji\",\"name\":\"iuxegth\",\"type\":\"rtudawlpjfel\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingRoleAssignments() - .listByInvoiceSection("vecjujcn", "oady", "dm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ialwv", response.iterator().next().principalId()); - Assertions.assertEquals("buhzacaq", response.iterator().next().principalTenantId()); - Assertions.assertEquals("ltcoqc", response.iterator().next().roleDefinitionId()); - Assertions.assertEquals("iztjof", response.iterator().next().userAuthenticationType()); - Assertions.assertEquals("vovjufycsjmlbe", response.iterator().next().userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.java deleted file mode 100644 index 2fce25917723..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; -import java.util.Arrays; - -public final class BillingRoleDefinitionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleDefinitionInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"afxtsgum\",\"permissions\":[{\"actions\":[],\"notActions\":[]},{\"actions\":[],\"notActions\":[]},{\"actions\":[],\"notActions\":[]}],\"roleName\":\"lo\"},\"id\":\"bq\",\"name\":\"vuzlm\",\"type\":\"felfktg\"}") - .toObject(BillingRoleDefinitionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleDefinitionInner model = - new BillingRoleDefinitionInner() - .withPermissions( - Arrays - .asList( - new BillingPermissionsPropertiesInner(), - new BillingPermissionsPropertiesInner(), - new BillingPermissionsPropertiesInner())); - model = BinaryData.fromObject(model).toObject(BillingRoleDefinitionInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.java deleted file mode 100644 index 725456c5ea18..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.BillingRoleDefinitionListResult; - -public final class BillingRoleDefinitionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleDefinitionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"phvwauyqncygu\",\"permissions\":[],\"roleName\":\"ipmdscwx\"},\"id\":\"upev\",\"name\":\"hfstotxhojujbyp\",\"type\":\"lmcuvhixb\"},{\"properties\":{\"description\":\"fw\",\"permissions\":[],\"roleName\":\"r\"},\"id\":\"ool\",\"name\":\"ttpkiwkkbnujrywv\",\"type\":\"y\"}],\"nextLink\":\"fpncurdo\"}") - .toObject(BillingRoleDefinitionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleDefinitionListResult model = new BillingRoleDefinitionListResult(); - model = BinaryData.fromObject(model).toObject(BillingRoleDefinitionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.java deleted file mode 100644 index 55a08efccb0d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionProperties; -import java.util.Arrays; - -public final class BillingRoleDefinitionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleDefinitionProperties model = - BinaryData - .fromString( - "{\"description\":\"crpw\",\"permissions\":[{\"actions\":[\"oi\",\"brnjwmw\",\"pn\"],\"notActions\":[\"zejjoqk\"]},{\"actions\":[\"hsxttaugzxnf\",\"azpxdtnkdmkqjjl\",\"uenvrkp\"],\"notActions\":[\"aibrebqaaysjkixq\",\"nqttezl\",\"fffiak\",\"jpqqmted\"]}],\"roleName\":\"mmji\"}") - .toObject(BillingRoleDefinitionProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleDefinitionProperties model = - new BillingRoleDefinitionProperties() - .withPermissions( - Arrays.asList(new BillingPermissionsPropertiesInner(), new BillingPermissionsPropertiesInner())); - model = BinaryData.fromObject(model).toObject(BillingRoleDefinitionProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.java deleted file mode 100644 index b9c07cb1f784..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests { - @Test - public void testGetByBillingAccountWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"ohapqinfsz\",\"permissions\":[],\"roleName\":\"qdhmrjzralcxpjby\"},\"id\":\"psjoqcjenk\",\"name\":\"hf\",\"type\":\"zv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleDefinition response = - manager - .billingRoleDefinitions() - .getByBillingAccountWithResponse("zqro", "tjzcfyjzpt", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java deleted file mode 100644 index 4686844917b0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests { - @Test - public void testGetByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"bklqpxz\",\"permissions\":[],\"roleName\":\"e\"},\"id\":\"dwwnl\",\"name\":\"a\",\"type\":\"wxudgn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleDefinition response = - manager - .billingRoleDefinitions() - .getByBillingProfileWithResponse( - "fwxzutg", "ztwhghmupg", "yjtcdxabbujftab", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java deleted file mode 100644 index 2cd34bcb3acc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests { - @Test - public void testGetByInvoiceSectionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"s\",\"permissions\":[],\"roleName\":\"jszlb\"},\"id\":\"cmnlzijiufehg\",\"name\":\"vflnwyvqkxrerln\",\"type\":\"ylyl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleDefinition response = - manager - .billingRoleDefinitions() - .getByInvoiceSectionWithResponse( - "qxfx", "elgcmpzqjhhhqx", "w", "vcacoyv", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.java deleted file mode 100644 index d6d0536e7de7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"bemeluclvd\",\"permissions\":[],\"roleName\":\"yrdnqod\"},\"id\":\"ahhxhqfaqnvzoqg\",\"name\":\"ipemchgavscz\",\"type\":\"ejdtxptl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingRoleDefinitions().listByBillingAccount("gookrtalvnb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.java deleted file mode 100644 index 27990a33c91d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"us\",\"permissions\":[],\"roleName\":\"u\"},\"id\":\"ioycbl\",\"name\":\"vpmclujyxkyxlz\",\"type\":\"sjgkzzltafh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingRoleDefinitions() - .listByBillingProfile("dbrxmrgc", "bapxkiyfjjkb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.java deleted file mode 100644 index d775f656d3e4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"odrrslblxyd\",\"permissions\":[],\"roleName\":\"vvbxiwkgfbqljnq\"},\"id\":\"hychocokuleh\",\"name\":\"rqlrqffawe\",\"type\":\"urkphyjdxravju\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingRoleDefinitions() - .listByInvoiceSection("h", "zhomewjjstliu", "qawmoaianc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.java deleted file mode 100644 index 3acee0e2615e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import org.junit.jupiter.api.Assertions; - -public final class BillingSubscriptionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingSubscriptionInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"pvgqzcjrvxdjzlm\",\"subscriptionId\":\"2b1ddf07-345e-4104-89d5-47cf0f0744f9\",\"subscriptionBillingStatus\":\"Warning\",\"lastMonthCharges\":{\"currency\":\"gfhzovawjvzunlut\",\"value\":1.0469615},\"monthToDateCharges\":{\"currency\":\"nxipeil\",\"value\":42.357708},\"billingProfileId\":\"aejxd\",\"billingProfileDisplayName\":\"tskzbbtdzumveek\",\"costCenter\":\"wozuhkf\",\"customerId\":\"sjyofdx\",\"customerDisplayName\":\"us\",\"invoiceSectionId\":\"touwaboekqv\",\"invoiceSectionDisplayName\":\"lns\",\"reseller\":{\"resellerId\":\"xwyjsflhhc\",\"description\":\"lnjixisxya\"},\"skuId\":\"oyaqcslyjpkiid\",\"skuDescription\":\"exznelixhnr\",\"suspensionReasons\":[\"o\",\"hb\",\"xknalaulppg\"]},\"id\":\"dtpnapnyiropuhp\",\"name\":\"gvpgy\",\"type\":\"gqgitxmedjvcsl\"}") - .toObject(BillingSubscriptionInner.class); - Assertions.assertEquals(BillingSubscriptionStatusType.WARNING, model.subscriptionBillingStatus()); - Assertions.assertEquals("wozuhkf", model.costCenter()); - Assertions.assertEquals("oyaqcslyjpkiid", model.skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingSubscriptionInner model = - new BillingSubscriptionInner() - .withSubscriptionBillingStatus(BillingSubscriptionStatusType.WARNING) - .withCostCenter("wozuhkf") - .withSkuId("oyaqcslyjpkiid"); - model = BinaryData.fromObject(model).toObject(BillingSubscriptionInner.class); - Assertions.assertEquals(BillingSubscriptionStatusType.WARNING, model.subscriptionBillingStatus()); - Assertions.assertEquals("wozuhkf", model.costCenter()); - Assertions.assertEquals("oyaqcslyjpkiid", model.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.java deleted file mode 100644 index 5d16bdc6bc4b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionProperties; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import org.junit.jupiter.api.Assertions; - -public final class BillingSubscriptionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingSubscriptionProperties model = - BinaryData - .fromString( - "{\"displayName\":\"qwwncw\",\"subscriptionId\":\"0b14bc39-5e00-4eb5-b288-987d4dfc4e21\",\"subscriptionBillingStatus\":\"Deleted\",\"lastMonthCharges\":{\"currency\":\"trmgucnapkte\",\"value\":45.423527},\"monthToDateCharges\":{\"currency\":\"pt\",\"value\":32.62289},\"billingProfileId\":\"pfqbuaceopzf\",\"billingProfileDisplayName\":\"hhuao\",\"costCenter\":\"pcqeqx\",\"customerId\":\"z\",\"customerDisplayName\":\"hzxct\",\"invoiceSectionId\":\"gbkdmoizpos\",\"invoiceSectionDisplayName\":\"grcfb\",\"reseller\":{\"resellerId\":\"mfqjhhkxbp\",\"description\":\"ymjhxxjyngudivkr\"},\"skuId\":\"wbxqzvszjfau\",\"skuDescription\":\"fdxxivetvtcqaqtd\",\"suspensionReasons\":[\"cbxvwvxyslqbh\",\"fxoblytkb\",\"mpew\"]}") - .toObject(BillingSubscriptionProperties.class); - Assertions.assertEquals(BillingSubscriptionStatusType.DELETED, model.subscriptionBillingStatus()); - Assertions.assertEquals("pcqeqx", model.costCenter()); - Assertions.assertEquals("wbxqzvszjfau", model.skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingSubscriptionProperties model = - new BillingSubscriptionProperties() - .withSubscriptionBillingStatus(BillingSubscriptionStatusType.DELETED) - .withCostCenter("pcqeqx") - .withSkuId("wbxqzvszjfau"); - model = BinaryData.fromObject(model).toObject(BillingSubscriptionProperties.class); - Assertions.assertEquals(BillingSubscriptionStatusType.DELETED, model.subscriptionBillingStatus()); - Assertions.assertEquals("pcqeqx", model.costCenter()); - Assertions.assertEquals("wbxqzvszjfau", model.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.java deleted file mode 100644 index 0a8d784af79c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"ctbrxkjzwrgxffm\",\"subscriptionId\":\"2b9128aa-6fd8-48c1-b298-8116567aa8b6\",\"subscriptionBillingStatus\":\"Inactive\",\"lastMonthCharges\":{\"currency\":\"kgozxwop\",\"value\":12.357336},\"monthToDateCharges\":{\"currency\":\"izqaclnapxbiyg\",\"value\":22.492695},\"billingProfileId\":\"knfsmfcttuxuuyil\",\"billingProfileDisplayName\":\"qoiquvrehmrnjhv\",\"costCenter\":\"jztczytqj\",\"customerId\":\"h\",\"customerDisplayName\":\"unfprnjletlxs\",\"invoiceSectionId\":\"pddouifamowaziyn\",\"invoiceSectionDisplayName\":\"lqwzdvpiwhxqsz\",\"reseller\":{\"resellerId\":\"aajquhuxylrj\",\"description\":\"ty\"},\"skuId\":\"bmzyospsps\",\"skuDescription\":\"kfkyjp\",\"suspensionReasons\":[\"bpssdfp\",\"yogtieyujtvczkcn\",\"xrx\"]},\"id\":\"unjdx\",\"name\":\"glnkvxlxpagl\",\"type\":\"ivbgkcv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingSubscription response = - manager.billingSubscriptions().getWithResponse("zvzbglbyv", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(BillingSubscriptionStatusType.INACTIVE, response.subscriptionBillingStatus()); - Assertions.assertEquals("jztczytqj", response.costCenter()); - Assertions.assertEquals("bmzyospsps", response.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.java deleted file mode 100644 index f2510d9eec0d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"xfe\",\"subscriptionId\":\"f4cbed26-4a2f-4ca0-a4a6-4fbfd837d0b6\",\"subscriptionBillingStatus\":\"Warning\",\"lastMonthCharges\":{\"currency\":\"xfdeqvhpsyl\",\"value\":14.799225},\"monthToDateCharges\":{\"currency\":\"bffmbmxz\",\"value\":50.71973},\"billingProfileId\":\"wwp\",\"billingProfileDisplayName\":\"xs\",\"costCenter\":\"tf\",\"customerId\":\"gicgaaoepttaq\",\"customerDisplayName\":\"dewemxswv\",\"invoiceSectionId\":\"unzzjgehk\",\"invoiceSectionDisplayName\":\"imrt\",\"reseller\":{\"resellerId\":\"kffqyinljqepqwh\",\"description\":\"monstshiyxgve\"},\"skuId\":\"clduc\",\"skuDescription\":\"irdsvuwcob\",\"suspensionReasons\":[\"stmninwjizcilng\",\"gshejjtbxqmulux\",\"xqzv\",\"ers\"]},\"id\":\"ycucrwnamikzeb\",\"name\":\"qbsms\",\"type\":\"ziqgfuh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingSubscriptions().listByBillingAccount("tcmwqkchc", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - BillingSubscriptionStatusType.WARNING, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("tf", response.iterator().next().costCenter()); - Assertions.assertEquals("clduc", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.java deleted file mode 100644 index b082a4f0ed76..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"jsxjwwix\",\"subscriptionId\":\"7b7f70e7-479e-4e08-aadc-7a1077abc191\",\"subscriptionBillingStatus\":\"Warning\",\"lastMonthCharges\":{\"currency\":\"xqhndvnoamlds\",\"value\":35.096104},\"monthToDateCharges\":{\"currency\":\"djh\",\"value\":24.296553},\"billingProfileId\":\"okxcoxp\",\"billingProfileDisplayName\":\"nje\",\"costCenter\":\"gltsxoat\",\"customerId\":\"g\",\"customerDisplayName\":\"npbs\",\"invoiceSectionId\":\"e\",\"invoiceSectionDisplayName\":\"occsr\",\"reseller\":{\"resellerId\":\"ihmipgawtxxpk\",\"description\":\"cxcjxgry\"},\"skuId\":\"mpcycilrmcaykgg\",\"skuDescription\":\"xu\",\"suspensionReasons\":[\"ksxwpnd\",\"cpfnznthjtwkja\",\"srxuzvoam\"]},\"id\":\"tcqiosmg\",\"name\":\"zah\",\"type\":\"xqdlyrtltlapr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingSubscriptions().listByBillingProfile("kzruswh", "hczznvf", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - BillingSubscriptionStatusType.WARNING, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("gltsxoat", response.iterator().next().costCenter()); - Assertions.assertEquals("mpcycilrmcaykgg", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.java deleted file mode 100644 index 7a8d00b444c8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByCustomerMockTests { - @Test - public void testListByCustomer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"qpofvwbc\",\"subscriptionId\":\"014c0863-e775-41aa-8863-c42b70db6758\",\"subscriptionBillingStatus\":\"Active\",\"lastMonthCharges\":{\"currency\":\"kbwvqvxkdiv\",\"value\":15.006906},\"monthToDateCharges\":{\"currency\":\"wtswbzuwfmdur\",\"value\":30.223448},\"billingProfileId\":\"izvcjfe\",\"billingProfileDisplayName\":\"sdjubggbqigkxkbs\",\"costCenter\":\"gak\",\"customerId\":\"cyrcmjdmspo\",\"customerDisplayName\":\"pv\",\"invoiceSectionId\":\"rylniofrzg\",\"invoiceSectionDisplayName\":\"jed\",\"reseller\":{\"resellerId\":\"kvnlvxbcuiiznkt\",\"description\":\"ansnvp\"},\"skuId\":\"bmikost\",\"skuDescription\":\"bkiw\",\"suspensionReasons\":[\"n\",\"ophzfylsgcrp\",\"bcunezzceze\"]},\"id\":\"fwyfwlwxjwet\",\"name\":\"psihcla\",\"type\":\"zvaylptrsqqw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingSubscriptions().listByCustomer("iiqbi", "htmwwinh", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals(BillingSubscriptionStatusType.ACTIVE, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("gak", response.iterator().next().costCenter()); - Assertions.assertEquals("bmikost", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java deleted file mode 100644 index a5d107a422e4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"qalarvlagunbtg\",\"subscriptionId\":\"5c8b1f82-54e3-4784-976b-0399b9cc76f0\",\"subscriptionBillingStatus\":\"Inactive\",\"lastMonthCharges\":{\"currency\":\"bmhyreeudz\",\"value\":93.786156},\"monthToDateCharges\":{\"currency\":\"dqmjxly\",\"value\":29.41463},\"billingProfileId\":\"gouwtlmj\",\"billingProfileDisplayName\":\"uojqt\",\"costCenter\":\"axkjeytunlbfjk\",\"customerId\":\"u\",\"customerDisplayName\":\"kqbh\",\"invoiceSectionId\":\"rqunjq\",\"invoiceSectionDisplayName\":\"enx\",\"reseller\":{\"resellerId\":\"kpak\",\"description\":\"ifmjnn\"},\"skuId\":\"tqabpxuckpgg\",\"skuDescription\":\"wey\",\"suspensionReasons\":[\"hlisngw\",\"lqqmpiz\",\"uwnpqxpxiwfcng\",\"saasiixtmkzj\"]},\"id\":\"kv\",\"name\":\"irhgfgrwsdp\",\"type\":\"ra\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingSubscriptions() - .listByInvoiceSection("tz", "atbhjmznn", "s", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - BillingSubscriptionStatusType.INACTIVE, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("axkjeytunlbfjk", response.iterator().next().costCenter()); - Assertions.assertEquals("tqabpxuckpgg", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.java deleted file mode 100644 index 5993ce87d082..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.BillingSubscriptionsListResult; - -public final class BillingSubscriptionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingSubscriptionsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"ck\",\"subscriptionId\":\"57d84afc-8b50-4f1e-81a9-e9cf06197dda\",\"subscriptionBillingStatus\":\"Warning\",\"billingProfileId\":\"bkyvp\",\"billingProfileDisplayName\":\"anuzbpzkafkuw\",\"costCenter\":\"rnwb\",\"customerId\":\"hhseyv\",\"customerDisplayName\":\"srtslhspkdeem\",\"invoiceSectionId\":\"fm\",\"invoiceSectionDisplayName\":\"gkvtmelmqkrhah\",\"skuId\":\"uahaquhcdhmd\",\"skuDescription\":\"laexqp\",\"suspensionReasons\":[]},\"id\":\"adm\",\"name\":\"sr\",\"type\":\"r\"},{\"properties\":{\"displayName\":\"pv\",\"subscriptionId\":\"bf8b6a2e-e5b5-4b61-aff8-d9ee31509c78\",\"subscriptionBillingStatus\":\"Warning\",\"billingProfileId\":\"isgwbnbbeldawkz\",\"billingProfileDisplayName\":\"liourqhak\",\"costCenter\":\"hashsfwxosow\",\"customerId\":\"cugicjoox\",\"customerDisplayName\":\"ebwpucwwfvo\",\"invoiceSectionId\":\"vmeueci\",\"invoiceSectionDisplayName\":\"hzceuojgjrwjue\",\"skuId\":\"wmcdytdxwi\",\"skuDescription\":\"nrjawgqwg\",\"suspensionReasons\":[]},\"id\":\"ni\",\"name\":\"kxfbkpycgklwndn\",\"type\":\"jdauwhvy\"},{\"properties\":{\"displayName\":\"btdhxujznbm\",\"subscriptionId\":\"ea622ed2-d4f9-469e-9daf-f1e91e5801ed\",\"subscriptionBillingStatus\":\"Abandoned\",\"billingProfileId\":\"zqlveualupjmkhf\",\"billingProfileDisplayName\":\"bbcswsrtjri\",\"costCenter\":\"rbpbewtghfgblcg\",\"customerId\":\"zvlvqhjkbegib\",\"customerDisplayName\":\"mxiebw\",\"invoiceSectionId\":\"loayqcgw\",\"invoiceSectionDisplayName\":\"zjuzgwyz\",\"skuId\":\"xongmtsavjcbpwxq\",\"skuDescription\":\"rknftguvriuhprwm\",\"suspensionReasons\":[]},\"id\":\"vxqtayriwwroyqbe\",\"name\":\"rmcqiby\",\"type\":\"nojvknmefqsg\"}],\"totalCount\":488274582,\"nextLink\":\"apj\"}") - .toObject(BillingSubscriptionsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingSubscriptionsListResult model = new BillingSubscriptionsListResult(); - model = BinaryData.fromObject(model).toObject(BillingSubscriptionsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.java deleted file mode 100644 index ee599838fb87..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsMoveMockTests { - @Test - public void testMove() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"ycxhxzgaztta\",\"subscriptionId\":\"d3cdb36f-7903-46a6-b127-4f7fed731bfc\",\"subscriptionBillingStatus\":\"Inactive\",\"lastMonthCharges\":{\"currency\":\"fqhppubowsep\",\"value\":1.4296412},\"monthToDateCharges\":{\"currency\":\"tdherngbtcjuahok\",\"value\":60.235302},\"billingProfileId\":\"kauxof\",\"billingProfileDisplayName\":\"fphwpnu\",\"costCenter\":\"iywzejy\",\"customerId\":\"slwkojpl\",\"customerDisplayName\":\"dnpdwrpqaf\",\"invoiceSectionId\":\"ug\",\"invoiceSectionDisplayName\":\"n\",\"reseller\":{\"resellerId\":\"et\",\"description\":\"ypococtfjgtixr\"},\"skuId\":\"zuyt\",\"skuDescription\":\"mlmuowol\",\"suspensionReasons\":[\"iropionszon\"]},\"id\":\"pngajin\",\"name\":\"ixjawrtm\",\"type\":\"fjmyccxlzhco\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingSubscription response = - manager - .billingSubscriptions() - .move( - "ffifhx", - new TransferBillingSubscriptionRequestProperties() - .withDestinationInvoiceSectionId("rsnewmozqvbubqma"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(BillingSubscriptionStatusType.INACTIVE, response.subscriptionBillingStatus()); - Assertions.assertEquals("iywzejy", response.costCenter()); - Assertions.assertEquals("zuyt", response.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.java deleted file mode 100644 index 9aa90fa79e15..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"nykzcugswvxwlm\",\"subscriptionId\":\"be4a2676-00c5-4065-a604-86209c2a264f\",\"subscriptionBillingStatus\":\"Abandoned\",\"lastMonthCharges\":{\"currency\":\"xnjmxm\",\"value\":51.97202},\"monthToDateCharges\":{\"currency\":\"tcvcl\",\"value\":25.977707},\"billingProfileId\":\"dkvgfabuiyjibuzp\",\"billingProfileDisplayName\":\"ugneikn\",\"costCenter\":\"oxgjiuqhibt\",\"customerId\":\"ipq\",\"customerDisplayName\":\"edmurrxxge\",\"invoiceSectionId\":\"ktvqylkmqpzoy\",\"invoiceSectionDisplayName\":\"fbcgwgcloxoebqin\",\"reseller\":{\"resellerId\":\"nwjfu\",\"description\":\"lafcbahh\"},\"skuId\":\"pofoi\",\"skuDescription\":\"w\",\"suspensionReasons\":[\"lkmkkholvdndvi\",\"uogphuartvtiuky\"]},\"id\":\"fchnmnah\",\"name\":\"nxhkxjqi\",\"type\":\"wrweoo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingSubscription response = - manager - .billingSubscriptions() - .updateWithResponse( - "hpzvuqdflvoniyp", - new BillingSubscriptionInner() - .withSubscriptionBillingStatus(BillingSubscriptionStatusType.INACTIVE) - .withCostCenter("nq") - .withSkuId("lacjfrnxo"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(BillingSubscriptionStatusType.ABANDONED, response.subscriptionBillingStatus()); - Assertions.assertEquals("oxgjiuqhibt", response.costCenter()); - Assertions.assertEquals("pofoi", response.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.java deleted file mode 100644 index cdd7a54c9bfe..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerInner; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Reseller; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CustomerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerInner model = - BinaryData - .fromString( - "{\"properties\":{\"billingProfileId\":\"l\",\"billingProfileDisplayName\":\"kx\",\"displayName\":\"skpbhenbtkcxywn\",\"enabledAzurePlans\":[{\"skuId\":\"synlqidybyxczfc\",\"skuDescription\":\"aaxdbabphlwrq\"}],\"resellers\":[{\"resellerId\":\"sthsu\",\"description\":\"cmnyyazttb\"},{\"resellerId\":\"wrqpue\",\"description\":\"kzywbiex\"},{\"resellerId\":\"eyueaxibxujwb\",\"description\":\"walm\"},{\"resellerId\":\"yoxa\",\"description\":\"dkzjancuxrh\"}]},\"id\":\"wbavxbniwdj\",\"name\":\"wz\",\"type\":\"s\"}") - .toObject(CustomerInner.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.displayName()); - Assertions.assertEquals("synlqidybyxczfc", model.enabledAzurePlans().get(0).skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerInner model = - new CustomerInner() - .withDisplayName("skpbhenbtkcxywn") - .withEnabledAzurePlans(Arrays.asList(new AzurePlan().withSkuId("synlqidybyxczfc"))) - .withResellers(Arrays.asList(new Reseller(), new Reseller(), new Reseller(), new Reseller())); - model = BinaryData.fromObject(model).toObject(CustomerInner.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.displayName()); - Assertions.assertEquals("synlqidybyxczfc", model.enabledAzurePlans().get(0).skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.java deleted file mode 100644 index 8ba53626bb2f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.CustomerListResult; - -public final class CustomerListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"billingProfileId\":\"kgj\",\"billingProfileDisplayName\":\"yoxgvcltbgsnc\",\"displayName\":\"kjeszz\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"jhtxfvgxbfsmxne\",\"name\":\"mpvecxgodebfqk\",\"type\":\"rbmpukgri\"},{\"properties\":{\"billingProfileId\":\"zlfbxzpuzycispnq\",\"billingProfileDisplayName\":\"hmgkbrpyy\",\"displayName\":\"ibnuqqkpik\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"gvtqagnbuynh\",\"name\":\"jggmebfsiarbu\",\"type\":\"rcvpnazzmhjrunmp\"}],\"totalCount\":18555434,\"nextLink\":\"bh\"}") - .toObject(CustomerListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerListResult model = new CustomerListResult(); - model = BinaryData.fromObject(model).toObject(CustomerListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.java deleted file mode 100644 index ee30de207ea8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.models.ViewCharges; -import org.junit.jupiter.api.Assertions; - -public final class CustomerPolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerPolicyInner model = - BinaryData - .fromString( - "{\"properties\":{\"viewCharges\":\"Allowed\"},\"id\":\"blmhvkzuhb\",\"name\":\"vvyhg\",\"type\":\"opbyrqufegxu\"}") - .toObject(CustomerPolicyInner.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerPolicyInner model = new CustomerPolicyInner().withViewCharges(ViewCharges.ALLOWED); - model = BinaryData.fromObject(model).toObject(CustomerPolicyInner.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.java deleted file mode 100644 index ad21f446961c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyProperties; -import com.azure.resourcemanager.billing.models.ViewCharges; -import org.junit.jupiter.api.Assertions; - -public final class CustomerPolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerPolicyProperties model = - BinaryData.fromString("{\"viewCharges\":\"Allowed\"}").toObject(CustomerPolicyProperties.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerPolicyProperties model = new CustomerPolicyProperties().withViewCharges(ViewCharges.ALLOWED); - model = BinaryData.fromObject(model).toObject(CustomerPolicyProperties.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.java deleted file mode 100644 index ae57b85f0fbb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerProperties; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Reseller; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CustomerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerProperties model = - BinaryData - .fromString( - "{\"billingProfileId\":\"pgn\",\"billingProfileDisplayName\":\"txhp\",\"displayName\":\"bzpfzab\",\"enabledAzurePlans\":[{\"skuId\":\"hxw\",\"skuDescription\":\"tyq\"}],\"resellers\":[{\"resellerId\":\"bovpl\",\"description\":\"bhvgy\"},{\"resellerId\":\"uosvmkfssxqukk\",\"description\":\"l\"}]}") - .toObject(CustomerProperties.class); - Assertions.assertEquals("bzpfzab", model.displayName()); - Assertions.assertEquals("hxw", model.enabledAzurePlans().get(0).skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerProperties model = - new CustomerProperties() - .withDisplayName("bzpfzab") - .withEnabledAzurePlans(Arrays.asList(new AzurePlan().withSkuId("hxw"))) - .withResellers(Arrays.asList(new Reseller(), new Reseller())); - model = BinaryData.fromObject(model).toObject(CustomerProperties.class); - Assertions.assertEquals("bzpfzab", model.displayName()); - Assertions.assertEquals("hxw", model.enabledAzurePlans().get(0).skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.java deleted file mode 100644 index 1a3aa1ce2c34..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Customer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"billingProfileId\":\"snmfpphojeevy\",\"billingProfileDisplayName\":\"hsgz\",\"displayName\":\"zbgomfgbeg\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"o\",\"name\":\"i\",\"type\":\"etnluankrrfx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Customer response = - manager - .customers() - .getWithResponse("tfnmdx", "tngfdgugeyzihgr", "yui", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zbgomfgbeg", response.displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.java deleted file mode 100644 index da483feb0537..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Customer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomersListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"billingProfileId\":\"aiouaubrjt\",\"billingProfileDisplayName\":\"qxfuojrngif\",\"displayName\":\"z\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"biuimzdlyjdfq\",\"name\":\"mkyoqufdvruzsl\",\"type\":\"ojhp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .customers() - .listByBillingAccount("qbnj", "rcgegydcwboxjum", "qqoli", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("z", response.iterator().next().displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.java deleted file mode 100644 index 2c114cfd1861..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Customer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomersListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"billingProfileId\":\"cxkjibnxmysuxswq\",\"billingProfileDisplayName\":\"tvlwijpsttexoq\",\"displayName\":\"wcyyufmhruncu\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"kcdqzhlct\",\"name\":\"dunqnd\",\"type\":\"fpch\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .customers() - .listByBillingProfile("xzsrzpge", "q", "yb", "wwpgdakchzyvlixq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wcyyufmhruncu", response.iterator().next().displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.java deleted file mode 100644 index 4dbe4734eb21..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.DepartmentProperties; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DepartmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DepartmentProperties model = - BinaryData - .fromString( - "{\"departmentName\":\"pg\",\"costCenter\":\"toc\",\"status\":\"xhvpmoue\",\"enrollmentAccounts\":[{\"properties\":{\"accountName\":\"i\",\"costCenter\":\"eojnxqbzvddn\",\"accountOwner\":\"ndei\",\"accountOwnerEmail\":\"twnpzaoqvuhrhcf\",\"status\":\"yd\",\"startDate\":\"2021-01-15T04:12:24Z\",\"endDate\":\"2021-08-14T20:27:10Z\"},\"id\":\"hjq\",\"name\":\"wpyeicxmqciwqvh\",\"type\":\"hix\"},{\"properties\":{\"accountName\":\"dtopbob\",\"costCenter\":\"ghmewuam\",\"accountOwner\":\"hrzayvvtpgvdf\",\"accountOwnerEmail\":\"otkftutqxlngx\",\"status\":\"fgugnxkrxdqmid\",\"startDate\":\"2021-09-08T21:12:41Z\",\"endDate\":\"2021-06-28T04:41:07Z\"},\"id\":\"qdrabhjybigehoqf\",\"name\":\"owskanyktz\",\"type\":\"cuiywgqyw\"},{\"properties\":{\"accountName\":\"rvynhzgpph\",\"costCenter\":\"gyncocpecfvmmc\",\"accountOwner\":\"fsxlzevgbmqjqa\",\"accountOwnerEmail\":\"y\",\"status\":\"ivkwlzuvccfwnfnb\",\"startDate\":\"2021-04-04T07:21:26Z\",\"endDate\":\"2021-04-16T12:59:12Z\"},\"id\":\"l\",\"name\":\"bxetqgtzxdpn\",\"type\":\"bqqwxrj\"},{\"properties\":{\"accountName\":\"llnwsubi\",\"costCenter\":\"jampmngnzscxaqw\",\"accountOwner\":\"chcbonqvpkvlrxnj\",\"accountOwnerEmail\":\"seiphe\",\"status\":\"lokeyy\",\"startDate\":\"2021-09-18T17:01:56Z\",\"endDate\":\"2021-10-04T06:36:31Z\"},\"id\":\"lwtgrhpdj\",\"name\":\"jumasx\",\"type\":\"zj\"}]}") - .toObject(DepartmentProperties.class); - Assertions.assertEquals("pg", model.departmentName()); - Assertions.assertEquals("toc", model.costCenter()); - Assertions.assertEquals("xhvpmoue", model.status()); - Assertions.assertEquals("i", model.enrollmentAccounts().get(0).accountName()); - Assertions.assertEquals("eojnxqbzvddn", model.enrollmentAccounts().get(0).costCenter()); - Assertions.assertEquals("ndei", model.enrollmentAccounts().get(0).accountOwner()); - Assertions.assertEquals("twnpzaoqvuhrhcf", model.enrollmentAccounts().get(0).accountOwnerEmail()); - Assertions.assertEquals("yd", model.enrollmentAccounts().get(0).status()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-15T04:12:24Z"), model.enrollmentAccounts().get(0).startDate()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-08-14T20:27:10Z"), model.enrollmentAccounts().get(0).endDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DepartmentProperties model = - new DepartmentProperties() - .withDepartmentName("pg") - .withCostCenter("toc") - .withStatus("xhvpmoue") - .withEnrollmentAccounts( - Arrays - .asList( - new EnrollmentAccount() - .withAccountName("i") - .withCostCenter("eojnxqbzvddn") - .withAccountOwner("ndei") - .withAccountOwnerEmail("twnpzaoqvuhrhcf") - .withStatus("yd") - .withStartDate(OffsetDateTime.parse("2021-01-15T04:12:24Z")) - .withEndDate(OffsetDateTime.parse("2021-08-14T20:27:10Z")), - new EnrollmentAccount() - .withAccountName("dtopbob") - .withCostCenter("ghmewuam") - .withAccountOwner("hrzayvvtpgvdf") - .withAccountOwnerEmail("otkftutqxlngx") - .withStatus("fgugnxkrxdqmid") - .withStartDate(OffsetDateTime.parse("2021-09-08T21:12:41Z")) - .withEndDate(OffsetDateTime.parse("2021-06-28T04:41:07Z")), - new EnrollmentAccount() - .withAccountName("rvynhzgpph") - .withCostCenter("gyncocpecfvmmc") - .withAccountOwner("fsxlzevgbmqjqa") - .withAccountOwnerEmail("y") - .withStatus("ivkwlzuvccfwnfnb") - .withStartDate(OffsetDateTime.parse("2021-04-04T07:21:26Z")) - .withEndDate(OffsetDateTime.parse("2021-04-16T12:59:12Z")), - new EnrollmentAccount() - .withAccountName("llnwsubi") - .withCostCenter("jampmngnzscxaqw") - .withAccountOwner("chcbonqvpkvlrxnj") - .withAccountOwnerEmail("seiphe") - .withStatus("lokeyy") - .withStartDate(OffsetDateTime.parse("2021-09-18T17:01:56Z")) - .withEndDate(OffsetDateTime.parse("2021-10-04T06:36:31Z")))); - model = BinaryData.fromObject(model).toObject(DepartmentProperties.class); - Assertions.assertEquals("pg", model.departmentName()); - Assertions.assertEquals("toc", model.costCenter()); - Assertions.assertEquals("xhvpmoue", model.status()); - Assertions.assertEquals("i", model.enrollmentAccounts().get(0).accountName()); - Assertions.assertEquals("eojnxqbzvddn", model.enrollmentAccounts().get(0).costCenter()); - Assertions.assertEquals("ndei", model.enrollmentAccounts().get(0).accountOwner()); - Assertions.assertEquals("twnpzaoqvuhrhcf", model.enrollmentAccounts().get(0).accountOwnerEmail()); - Assertions.assertEquals("yd", model.enrollmentAccounts().get(0).status()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-15T04:12:24Z"), model.enrollmentAccounts().get(0).startDate()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-08-14T20:27:10Z"), model.enrollmentAccounts().get(0).endDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.java deleted file mode 100644 index 51f7b45d5b2f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Department; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DepartmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Department model = - BinaryData - .fromString( - "{\"properties\":{\"departmentName\":\"hhbcsglummajtjao\",\"costCenter\":\"obnbdxkqpxokaj\",\"status\":\"npime\",\"enrollmentAccounts\":[{\"id\":\"xgcp\",\"name\":\"dg\",\"type\":\"aajrm\"},{\"id\":\"jwzrl\",\"name\":\"vmclw\",\"type\":\"ijcoejctb\"}]},\"id\":\"aqsqsycbkbfk\",\"name\":\"ukdkexxppofmxa\",\"type\":\"c\"}") - .toObject(Department.class); - Assertions.assertEquals("hhbcsglummajtjao", model.departmentName()); - Assertions.assertEquals("obnbdxkqpxokaj", model.costCenter()); - Assertions.assertEquals("npime", model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Department model = - new Department() - .withDepartmentName("hhbcsglummajtjao") - .withCostCenter("obnbdxkqpxokaj") - .withStatus("npime") - .withEnrollmentAccounts(Arrays.asList(new EnrollmentAccount(), new EnrollmentAccount())); - model = BinaryData.fromObject(model).toObject(Department.class); - Assertions.assertEquals("hhbcsglummajtjao", model.departmentName()); - Assertions.assertEquals("obnbdxkqpxokaj", model.costCenter()); - Assertions.assertEquals("npime", model.status()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.java deleted file mode 100644 index 4beb0e904a48..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.Document; - -public final class DocumentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Document model = - BinaryData - .fromString("{\"kind\":\"VoidNote\",\"url\":\"egokdwbwhkszzcmr\",\"source\":\"ENF\"}") - .toObject(Document.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Document model = new Document(); - model = BinaryData.fromObject(model).toObject(Document.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.java deleted file mode 100644 index 3f5a837aba0f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; - -public final class DownloadUrlInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DownloadUrlInner model = - BinaryData - .fromString("{\"expiryTime\":\"2021-09-27T05:33:50Z\",\"url\":\"grtwae\"}") - .toObject(DownloadUrlInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DownloadUrlInner model = new DownloadUrlInner(); - model = BinaryData.fromObject(model).toObject(DownloadUrlInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.java deleted file mode 100644 index a6e7c470c1ea..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.EnrollmentAccountListResult; - -public final class EnrollmentAccountListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"principalName\":\"f\"},\"id\":\"fcjnaeoisrvhmgor\",\"name\":\"fukiscvwmzhw\",\"type\":\"lefaxvxilcbtgn\"},{\"properties\":{\"principalName\":\"eyqxtjjfzql\"},\"id\":\"hycav\",\"name\":\"dggxdbeesmi\",\"type\":\"knlrariaawiuagy\"},{\"properties\":{\"principalName\":\"fbylyrfg\"},\"id\":\"agt\",\"name\":\"ojocqwogf\",\"type\":\"zjvusfzldmo\"}],\"nextLink\":\"xylfsb\"}") - .toObject(EnrollmentAccountListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountListResult model = new EnrollmentAccountListResult(); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.java deleted file mode 100644 index 4ab1938bb115..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountProperties; -import com.azure.resourcemanager.billing.models.Department; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EnrollmentAccountPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountProperties model = - BinaryData - .fromString( - "{\"accountName\":\"dkcglhsl\",\"costCenter\":\"jdyggdtji\",\"accountOwner\":\"b\",\"accountOwnerEmail\":\"ofqweykhmenevfye\",\"status\":\"whybcib\",\"startDate\":\"2021-05-14T16:24:46Z\",\"endDate\":\"2021-01-31T06:13:45Z\",\"department\":{\"properties\":{\"departmentName\":\"ynnaam\",\"costCenter\":\"ctehfiqscjey\",\"status\":\"hezrkgq\",\"enrollmentAccounts\":[]},\"id\":\"refovgmkqsleyyvx\",\"name\":\"qjpkcattpngjcrc\",\"type\":\"zsqpjhvmdajvny\"}}") - .toObject(EnrollmentAccountProperties.class); - Assertions.assertEquals("dkcglhsl", model.accountName()); - Assertions.assertEquals("jdyggdtji", model.costCenter()); - Assertions.assertEquals("b", model.accountOwner()); - Assertions.assertEquals("ofqweykhmenevfye", model.accountOwnerEmail()); - Assertions.assertEquals("whybcib", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T16:24:46Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T06:13:45Z"), model.endDate()); - Assertions.assertEquals("ynnaam", model.department().departmentName()); - Assertions.assertEquals("ctehfiqscjey", model.department().costCenter()); - Assertions.assertEquals("hezrkgq", model.department().status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountProperties model = - new EnrollmentAccountProperties() - .withAccountName("dkcglhsl") - .withCostCenter("jdyggdtji") - .withAccountOwner("b") - .withAccountOwnerEmail("ofqweykhmenevfye") - .withStatus("whybcib") - .withStartDate(OffsetDateTime.parse("2021-05-14T16:24:46Z")) - .withEndDate(OffsetDateTime.parse("2021-01-31T06:13:45Z")) - .withDepartment( - new Department() - .withDepartmentName("ynnaam") - .withCostCenter("ctehfiqscjey") - .withStatus("hezrkgq") - .withEnrollmentAccounts(Arrays.asList())); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountProperties.class); - Assertions.assertEquals("dkcglhsl", model.accountName()); - Assertions.assertEquals("jdyggdtji", model.costCenter()); - Assertions.assertEquals("b", model.accountOwner()); - Assertions.assertEquals("ofqweykhmenevfye", model.accountOwnerEmail()); - Assertions.assertEquals("whybcib", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T16:24:46Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T06:13:45Z"), model.endDate()); - Assertions.assertEquals("ynnaam", model.department().departmentName()); - Assertions.assertEquals("ctehfiqscjey", model.department().costCenter()); - Assertions.assertEquals("hezrkgq", model.department().status()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.java deleted file mode 100644 index 67997837bb62..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; - -public final class EnrollmentAccountSummaryInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountSummaryInner model = - BinaryData - .fromString( - "{\"properties\":{\"principalName\":\"dp\"},\"id\":\"s\",\"name\":\"wn\",\"type\":\"tgkbugrjqctojc\"}") - .toObject(EnrollmentAccountSummaryInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountSummaryInner model = new EnrollmentAccountSummaryInner(); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountSummaryInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.java deleted file mode 100644 index 2cef8c3b4460..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryProperties; - -public final class EnrollmentAccountSummaryPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountSummaryProperties model = - BinaryData - .fromString("{\"principalName\":\"sofieypefojyqd\"}") - .toObject(EnrollmentAccountSummaryProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountSummaryProperties model = new EnrollmentAccountSummaryProperties(); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountSummaryProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.java deleted file mode 100644 index 8025c43c1c06..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.Department; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class EnrollmentAccountTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccount model = - BinaryData - .fromString( - "{\"properties\":{\"accountName\":\"e\",\"costCenter\":\"alhbx\",\"accountOwner\":\"e\",\"accountOwnerEmail\":\"zzvdudgwds\",\"status\":\"hotwmcynpwlbjnp\",\"startDate\":\"2021-06-10T20:31:16Z\",\"endDate\":\"2021-04-17T12:51:37Z\",\"department\":{\"id\":\"ehxnltyfsop\",\"name\":\"usue\",\"type\":\"nzwdejba\"}},\"id\":\"orxzdmohctbqvud\",\"name\":\"xdn\",\"type\":\"nvowgujju\"}") - .toObject(EnrollmentAccount.class); - Assertions.assertEquals("e", model.accountName()); - Assertions.assertEquals("alhbx", model.costCenter()); - Assertions.assertEquals("e", model.accountOwner()); - Assertions.assertEquals("zzvdudgwds", model.accountOwnerEmail()); - Assertions.assertEquals("hotwmcynpwlbjnp", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T20:31:16Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T12:51:37Z"), model.endDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccount model = - new EnrollmentAccount() - .withAccountName("e") - .withCostCenter("alhbx") - .withAccountOwner("e") - .withAccountOwnerEmail("zzvdudgwds") - .withStatus("hotwmcynpwlbjnp") - .withStartDate(OffsetDateTime.parse("2021-06-10T20:31:16Z")) - .withEndDate(OffsetDateTime.parse("2021-04-17T12:51:37Z")) - .withDepartment(new Department()); - model = BinaryData.fromObject(model).toObject(EnrollmentAccount.class); - Assertions.assertEquals("e", model.accountName()); - Assertions.assertEquals("alhbx", model.costCenter()); - Assertions.assertEquals("e", model.accountOwner()); - Assertions.assertEquals("zzvdudgwds", model.accountOwnerEmail()); - Assertions.assertEquals("hotwmcynpwlbjnp", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T20:31:16Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T12:51:37Z"), model.endDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java deleted file mode 100644 index 4610563f8701..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.EnrollmentAccountSummary; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnrollmentAccountsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principalName\":\"cvtlubseskvc\"},\"id\":\"artr\",\"name\":\"unlpirykycndz\",\"type\":\"qi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnrollmentAccountSummary response = - manager.enrollmentAccounts().getWithResponse("fgvmx", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.java deleted file mode 100644 index 0611c06bd47c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.EnrollmentAccountSummary; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnrollmentAccountsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principalName\":\"fytpqsixymmpuji\"},\"id\":\"yqlkju\",\"name\":\"smbmslzoy\",\"type\":\"vwzdbpqvyb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.enrollmentAccounts().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.java deleted file mode 100644 index 474c62f78de7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.EnrollmentPolicies; - -public final class EnrollmentPoliciesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentPolicies model = - BinaryData - .fromString( - "{\"accountOwnerViewCharges\":false,\"departmentAdminViewCharges\":false,\"marketplaceEnabled\":false,\"reservedInstancesEnabled\":true}") - .toObject(EnrollmentPolicies.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentPolicies model = new EnrollmentPolicies(); - model = BinaryData.fromObject(model).toObject(EnrollmentPolicies.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.java deleted file mode 100644 index 6043de8cbb2c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.IndirectRelationshipInfo; -import org.junit.jupiter.api.Assertions; - -public final class IndirectRelationshipInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IndirectRelationshipInfo model = - BinaryData - .fromString( - "{\"billingAccountName\":\"bdkvwrwjf\",\"billingProfileName\":\"snhu\",\"displayName\":\"eltmrldhugjzzdat\"}") - .toObject(IndirectRelationshipInfo.class); - Assertions.assertEquals("bdkvwrwjf", model.billingAccountName()); - Assertions.assertEquals("snhu", model.billingProfileName()); - Assertions.assertEquals("eltmrldhugjzzdat", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IndirectRelationshipInfo model = - new IndirectRelationshipInfo() - .withBillingAccountName("bdkvwrwjf") - .withBillingProfileName("snhu") - .withDisplayName("eltmrldhugjzzdat"); - model = BinaryData.fromObject(model).toObject(IndirectRelationshipInfo.class); - Assertions.assertEquals("bdkvwrwjf", model.billingAccountName()); - Assertions.assertEquals("snhu", model.billingProfileName()); - Assertions.assertEquals("eltmrldhugjzzdat", model.displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.java deleted file mode 100644 index 29983a65ecb5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class InstructionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstructionInner model = - BinaryData - .fromString( - "{\"properties\":{\"amount\":10.419273,\"startDate\":\"2021-09-25T01:29:01Z\",\"endDate\":\"2021-09-15T09:48:55Z\",\"creationDate\":\"2021-10-30T19:28:33Z\"},\"id\":\"ypewrmjmwvvjekt\",\"name\":\"xsenhwlr\",\"type\":\"ffrzpwvlqdqgbiqy\"}") - .toObject(InstructionInner.class); - Assertions.assertEquals(10.419273f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T01:29:01Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T09:48:55Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T19:28:33Z"), model.creationDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstructionInner model = - new InstructionInner() - .withAmount(10.419273f) - .withStartDate(OffsetDateTime.parse("2021-09-25T01:29:01Z")) - .withEndDate(OffsetDateTime.parse("2021-09-15T09:48:55Z")) - .withCreationDate(OffsetDateTime.parse("2021-10-30T19:28:33Z")); - model = BinaryData.fromObject(model).toObject(InstructionInner.class); - Assertions.assertEquals(10.419273f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T01:29:01Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T09:48:55Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T19:28:33Z"), model.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.java deleted file mode 100644 index ad555a22127e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.InstructionListResult; - -public final class InstructionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstructionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"amount\":14.028668,\"startDate\":\"2021-02-05T11:01:53Z\",\"endDate\":\"2021-08-09T18:56:36Z\",\"creationDate\":\"2021-10-09T04:22:59Z\"},\"id\":\"yhxdeoejzicwi\",\"name\":\"sjttgzfbish\",\"type\":\"bkh\"},{\"properties\":{\"amount\":99.54184,\"startDate\":\"2021-05-05T10:08:59Z\",\"endDate\":\"2021-10-22T18:26:04Z\",\"creationDate\":\"2021-07-28T01:41:30Z\"},\"id\":\"md\",\"name\":\"hagalpbuxwgipwh\",\"type\":\"nowkgshw\"},{\"properties\":{\"amount\":13.87347,\"startDate\":\"2021-02-10T18:27Z\",\"endDate\":\"2021-05-09T01:51:01Z\",\"creationDate\":\"2021-05-05T18:01:17Z\"},\"id\":\"njeputtmrywn\",\"name\":\"zoqftiyqzrnkcqvy\",\"type\":\"lwh\"},{\"properties\":{\"amount\":81.865715,\"startDate\":\"2021-07-23T19:47:42Z\",\"endDate\":\"2021-07-17T17:56:48Z\",\"creationDate\":\"2021-12-09T22:32:32Z\"},\"id\":\"oqqnwvlryav\",\"name\":\"hheunmmqhgyx\",\"type\":\"konocu\"}],\"nextLink\":\"klyaxuconu\"}") - .toObject(InstructionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstructionListResult model = new InstructionListResult(); - model = BinaryData.fromObject(model).toObject(InstructionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.java deleted file mode 100644 index 53907b59c7f0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InstructionProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class InstructionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstructionProperties model = - BinaryData - .fromString( - "{\"amount\":70.4461,\"startDate\":\"2021-04-18T21:39:40Z\",\"endDate\":\"2021-05-04T00:16:05Z\",\"creationDate\":\"2021-11-21T07:12:40Z\"}") - .toObject(InstructionProperties.class); - Assertions.assertEquals(70.4461f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T21:39:40Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T00:16:05Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T07:12:40Z"), model.creationDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstructionProperties model = - new InstructionProperties() - .withAmount(70.4461f) - .withStartDate(OffsetDateTime.parse("2021-04-18T21:39:40Z")) - .withEndDate(OffsetDateTime.parse("2021-05-04T00:16:05Z")) - .withCreationDate(OffsetDateTime.parse("2021-11-21T07:12:40Z")); - model = BinaryData.fromObject(model).toObject(InstructionProperties.class); - Assertions.assertEquals(70.4461f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T21:39:40Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T00:16:05Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T07:12:40Z"), model.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.java deleted file mode 100644 index 1304f5179f84..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Instruction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InstructionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"amount\":10.233182,\"startDate\":\"2021-09-29T04:01:44Z\",\"endDate\":\"2021-02-26T01:00:55Z\",\"creationDate\":\"2021-10-29T14:07:51Z\"},\"id\":\"k\",\"name\":\"crjdqnsdfzpbgtg\",\"type\":\"ylkdghrje\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Instruction response = - manager - .instructions() - .getWithResponse("rwhryvycytd", "lxgccknfnwmbtm", "pdvjdhttzaefedx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(10.233182f, response.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-29T04:01:44Z"), response.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T01:00:55Z"), response.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-29T14:07:51Z"), response.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.java deleted file mode 100644 index 0706ffdd8508..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Instruction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InstructionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"amount\":55.698055,\"startDate\":\"2021-06-09T23:46:46Z\",\"endDate\":\"2021-07-18T03:27:54Z\",\"creationDate\":\"2020-12-23T14:53:02Z\"},\"id\":\"kkjqnvbroylaxxu\",\"name\":\"cdisd\",\"type\":\"sfjbjsvg\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .instructions() - .listByBillingProfile("ckknhxkizvy", "nrzvuljraaer", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(55.698055f, response.iterator().next().amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-09T23:46:46Z"), response.iterator().next().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-18T03:27:54Z"), response.iterator().next().endDate()); - Assertions - .assertEquals(OffsetDateTime.parse("2020-12-23T14:53:02Z"), response.iterator().next().creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java deleted file mode 100644 index 8c03ce6dab65..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import com.azure.resourcemanager.billing.models.Instruction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InstructionsPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"amount\":93.32798,\"startDate\":\"2021-05-04T10:42:41Z\",\"endDate\":\"2021-06-18T11:18:37Z\",\"creationDate\":\"2021-01-31T17:13:55Z\"},\"id\":\"egprhptil\",\"name\":\"ucb\",\"type\":\"qtgdqohmcwsl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Instruction response = - manager - .instructions() - .putWithResponse( - "utlwxezwzhok", - "bwnhhtql", - "ehgpp", - new InstructionInner() - .withAmount(30.197609f) - .withStartDate(OffsetDateTime.parse("2021-08-28T07:02:54Z")) - .withEndDate(OffsetDateTime.parse("2021-04-06T03:44:21Z")) - .withCreationDate(OffsetDateTime.parse("2021-01-02T20:54:57Z")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(93.32798f, response.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T10:42:41Z"), response.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T11:18:37Z"), response.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T17:13:55Z"), response.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.java deleted file mode 100644 index 97de427db41d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; - -public final class InvoiceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceInner model = - BinaryData - .fromString( - "{\"properties\":{\"dueDate\":\"2021-03-11T11:23:32Z\",\"invoiceDate\":\"2021-08-15T11:45:06Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"zkzivgvvcnay\",\"value\":67.249825},\"azurePrepaymentApplied\":{\"currency\":\"xxmueedn\",\"value\":33.27728},\"billedAmount\":{\"currency\":\"tkwqqtchealm\",\"value\":65.58801},\"creditAmount\":{\"currency\":\"aygdvwvgpioh\",\"value\":50.264233},\"freeAzureCreditApplied\":{\"currency\":\"fudxepxgyqagvrv\",\"value\":39.926674},\"subTotal\":{\"currency\":\"kghimdblxgwimfnj\",\"value\":1.0266364},\"taxAmount\":{\"currency\":\"mszkkfo\",\"value\":56.352932},\"totalAmount\":{\"currency\":\"kzikfjawneaivxwc\",\"value\":55.13192},\"invoicePeriodStartDate\":\"2021-05-21T02:26:51Z\",\"invoicePeriodEndDate\":\"2021-02-26T20:53:26Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"aenwabf\",\"billingProfileDisplayName\":\"kl\",\"purchaseOrderNumber\":\"xbjhwuaanozjosph\",\"documents\":[{\"kind\":\"VoidNote\",\"url\":\"rvxaglrvimjwosy\",\"source\":\"DRS\"},{\"kind\":\"CreditNote\",\"url\":\"kfcktqum\",\"source\":\"ENF\"}],\"payments\":[{\"paymentType\":\"zikhl\",\"date\":\"2021-07-20T01:18:29Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"gge\"}],\"rebillDetails\":{\"mjsjqb\":{\"creditNoteDocumentId\":\"ygaeqidbqfatpxl\",\"invoiceDocumentId\":\"xcyjmoadsuvarmy\",\"rebillDetails\":{}},\"ajxq\":{\"creditNoteDocumentId\":\"hyxxrwlycoduhpk\",\"invoiceDocumentId\":\"gymare\",\"rebillDetails\":{}},\"mnjijpxacqqudf\":{\"creditNoteDocumentId\":\"jhkycub\",\"invoiceDocumentId\":\"dgssofwqmzqal\",\"rebillDetails\":{}}},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"baaa\",\"creditForDocumentId\":\"yvayffimrzr\",\"subscriptionId\":\"zqogse\"},\"id\":\"nevfdnw\",\"name\":\"wmewzsyy\",\"type\":\"euzsoi\"}") - .toObject(InvoiceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceInner model = new InvoiceInner(); - model = BinaryData.fromObject(model).toObject(InvoiceInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.java deleted file mode 100644 index 4c9b987e40d1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.InvoiceListResult; - -public final class InvoiceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"dueDate\":\"2021-11-02T07:24:48Z\",\"invoiceDate\":\"2021-08-02T06:07:15Z\",\"status\":\"Void\",\"invoicePeriodStartDate\":\"2021-05-26T19:07:11Z\",\"invoicePeriodEndDate\":\"2021-11-15T11:38:05Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"btkuwhh\",\"billingProfileDisplayName\":\"ykojoxafnndlpic\",\"purchaseOrderNumber\":\"o\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"bpkkpwdre\",\"creditForDocumentId\":\"ovvqfovljxywsu\",\"subscriptionId\":\"yrs\"},\"id\":\"dsytgadgvr\",\"name\":\"ea\",\"type\":\"neqn\"},{\"properties\":{\"dueDate\":\"2021-06-18T06:35:15Z\",\"invoiceDate\":\"2021-01-11T09:26Z\",\"status\":\"Due\",\"invoicePeriodStartDate\":\"2021-12-01T10:12:44Z\",\"invoicePeriodEndDate\":\"2021-03-07T01:40:14Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"ji\",\"billingProfileDisplayName\":\"wifto\",\"purchaseOrderNumber\":\"kvpuvksgplsaknyn\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"huopxodlqiynto\",\"creditForDocumentId\":\"ihleos\",\"subscriptionId\":\"w\"},\"id\":\"rmslyzrpzbchckqq\",\"name\":\"qioxi\",\"type\":\"suiizynkedyat\"},{\"properties\":{\"dueDate\":\"2021-10-29T12:30:56Z\",\"invoiceDate\":\"2021-05-21T15:42:34Z\",\"status\":\"Due\",\"invoicePeriodStartDate\":\"2021-08-31T01:44:30Z\",\"invoicePeriodEndDate\":\"2021-02-06T08:02:04Z\",\"invoiceType\":\"AzureMarketplace\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"umnzgmwznmabik\",\"billingProfileDisplayName\":\"orgjhxbldt\",\"purchaseOrderNumber\":\"wrlkdmtn\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"lxdy\",\"creditForDocumentId\":\"syocogjltdtbnnha\",\"subscriptionId\":\"ocrkvcikh\"},\"id\":\"vpa\",\"name\":\"qgxqquezikyw\",\"type\":\"gxk\"}],\"nextLink\":\"la\",\"totalCount\":1870481937}") - .toObject(InvoiceListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceListResult model = new InvoiceListResult(); - model = BinaryData.fromObject(model).toObject(InvoiceListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.java deleted file mode 100644 index 98c428791ddf..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceProperties; - -public final class InvoicePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceProperties model = - BinaryData - .fromString( - "{\"dueDate\":\"2021-09-06T23:25:45Z\",\"invoiceDate\":\"2021-11-18T11:14:43Z\",\"status\":\"Due\",\"amountDue\":{\"currency\":\"rthzvaytdwkqbrqu\",\"value\":67.445885},\"azurePrepaymentApplied\":{\"currency\":\"exiili\",\"value\":42.678963},\"billedAmount\":{\"currency\":\"irqtdqoa\",\"value\":4.6766224},\"creditAmount\":{\"currency\":\"fgsqu\",\"value\":38.977768},\"freeAzureCreditApplied\":{\"currency\":\"xleptramx\",\"value\":16.920918},\"subTotal\":{\"currency\":\"wnwxuqlcvyd\",\"value\":76.745186},\"taxAmount\":{\"currency\":\"ooaojkniodkooebw\",\"value\":34.47978},\"totalAmount\":{\"currency\":\"mmsbvdkcrodtjin\",\"value\":99.528564},\"invoicePeriodStartDate\":\"2021-11-16T20:55:55Z\",\"invoicePeriodEndDate\":\"2021-06-24T17:33:05Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"efkdlf\",\"billingProfileDisplayName\":\"kggkfpa\",\"purchaseOrderNumber\":\"owpulpq\",\"documents\":[{\"kind\":\"Invoice\",\"url\":\"xkqjnsjervt\",\"source\":\"DRS\"},{\"kind\":\"VoidNote\",\"url\":\"sz\",\"source\":\"ENF\"},{\"kind\":\"VoidNote\",\"url\":\"zkfzbeyv\",\"source\":\"DRS\"}],\"payments\":[{\"paymentType\":\"invkjjxdxrbuu\",\"amount\":{\"currency\":\"lewyhmlwpaz\",\"value\":41.111607},\"date\":\"2021-01-30T03:38:42Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"kwyfzqwhxxbuyqax\"},{\"paymentType\":\"eqz\",\"amount\":{\"currency\":\"riolxorjalt\",\"value\":80.87304},\"date\":\"2021-02-06T08:10:47Z\",\"paymentMethodFamily\":\"CheckWire\",\"paymentMethodType\":\"bqwcsdbnwdcf\"},{\"paymentType\":\"cqdpfuv\",\"amount\":{\"currency\":\"bjj\",\"value\":36.3222},\"date\":\"2021-05-27T00:53:27Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"vudutncor\"},{\"paymentType\":\"lxqtvcofudfl\",\"amount\":{\"currency\":\"jub\",\"value\":57.222305},\"date\":\"2021-10-26T17:09:29Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"aznqntoru\"}],\"rebillDetails\":{\"aeburuvdmo\":{\"creditNoteDocumentId\":\"a\",\"invoiceDocumentId\":\"kycgrauwj\",\"rebillDetails\":{}},\"fkifr\":{\"creditNoteDocumentId\":\"mz\",\"invoiceDocumentId\":\"wabm\",\"rebillDetails\":{}},\"ujitcjedftww\":{\"creditNoteDocumentId\":\"puqujmqlgkfbtn\",\"invoiceDocumentId\":\"aongbj\",\"rebillDetails\":{}},\"oqouicybxarzgszu\":{\"creditNoteDocumentId\":\"zkoj\",\"invoiceDocumentId\":\"c\",\"rebillDetails\":{}}},\"documentType\":\"Invoice\",\"billedDocumentId\":\"iqopidoamciod\",\"creditForDocumentId\":\"haz\",\"subscriptionId\":\"hnzbonl\"}") - .toObject(InvoiceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceProperties model = new InvoiceProperties(); - model = BinaryData.fromObject(model).toObject(InvoiceProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.java deleted file mode 100644 index a8b299df0c6f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InvoiceSectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"awrlyx\",\"labels\":{\"nwbxgjvtbvpyssz\":\"cpr\",\"guhmuouqfpr\":\"nruj\"},\"state\":\"Restricted\",\"systemId\":\"nguitnwuizgazxu\",\"tags\":{\"hr\":\"uckyf\",\"zwdzuh\":\"idf\"},\"targetCloud\":\"USGov\"},\"id\":\"wisdkft\",\"name\":\"wxmnteiwao\",\"type\":\"vkmijcmmxdcuf\"}") - .toObject(InvoiceSectionInner.class); - Assertions.assertEquals("awrlyx", model.displayName()); - Assertions.assertEquals("cpr", model.labels().get("nwbxgjvtbvpyssz")); - Assertions.assertEquals("uckyf", model.tags().get("hr")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionInner model = - new InvoiceSectionInner() - .withDisplayName("awrlyx") - .withLabels(mapOf("nwbxgjvtbvpyssz", "cpr", "guhmuouqfpr", "nruj")) - .withTags(mapOf("hr", "uckyf", "zwdzuh", "idf")); - model = BinaryData.fromObject(model).toObject(InvoiceSectionInner.class); - Assertions.assertEquals("awrlyx", model.displayName()); - Assertions.assertEquals("cpr", model.labels().get("nwbxgjvtbvpyssz")); - Assertions.assertEquals("uckyf", model.tags().get("hr")); - } - - @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/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.java deleted file mode 100644 index f97b11dd1f8b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.InvoiceSectionListResult; - -public final class InvoiceSectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"wzbaiue\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"nyqupedeojnabck\",\"tags\":{},\"targetCloud\":\"USNat\"},\"id\":\"xpsiebtfhvpes\",\"name\":\"pskrdqmh\",\"type\":\"jdhtldwkyzxu\"},{\"properties\":{\"displayName\":\"ncwscwsvlxoto\",\"labels\":{},\"state\":\"Restricted\",\"systemId\":\"pqsxvnmicy\",\"tags\":{},\"targetCloud\":\"USSec\"},\"id\":\"o\",\"name\":\"eil\",\"type\":\"vnotyfjfcnj\"}],\"totalCount\":534363981,\"nextLink\":\"x\"}") - .toObject(InvoiceSectionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionListResult model = new InvoiceSectionListResult(); - model = BinaryData.fromObject(model).toObject(InvoiceSectionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.java deleted file mode 100644 index 326974611266..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InvoiceSectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionProperties model = - BinaryData - .fromString( - "{\"displayName\":\"srp\",\"labels\":{\"sgfyccsnew\":\"idnsezcxtb\",\"oosflnr\":\"dwzjeiach\",\"vypyqrimzinpv\":\"sfqpteehz\",\"rsoodqxhcrmnoh\":\"wjdk\"},\"state\":\"Active\",\"systemId\":\"whdsoifiyip\",\"tags\":{\"rcjxvsnbyxqabn\":\"qwpgrjbzn\",\"hurzafblj\":\"ocpcy\"},\"targetCloud\":\"USGov\"}") - .toObject(InvoiceSectionProperties.class); - Assertions.assertEquals("srp", model.displayName()); - Assertions.assertEquals("idnsezcxtb", model.labels().get("sgfyccsnew")); - Assertions.assertEquals("qwpgrjbzn", model.tags().get("rcjxvsnbyxqabn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionProperties model = - new InvoiceSectionProperties() - .withDisplayName("srp") - .withLabels( - mapOf( - "sgfyccsnew", - "idnsezcxtb", - "oosflnr", - "dwzjeiach", - "vypyqrimzinpv", - "sfqpteehz", - "rsoodqxhcrmnoh", - "wjdk")) - .withTags(mapOf("rcjxvsnbyxqabn", "qwpgrjbzn", "hurzafblj", "ocpcy")); - model = BinaryData.fromObject(model).toObject(InvoiceSectionProperties.class); - Assertions.assertEquals("srp", model.displayName()); - Assertions.assertEquals("idnsezcxtb", model.labels().get("sgfyccsnew")); - Assertions.assertEquals("qwpgrjbzn", model.tags().get("rcjxvsnbyxqabn")); - } - - @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/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.java deleted file mode 100644 index e02362158b91..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoiceSectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"fqwazlnqnmcjn\",\"labels\":{\"sf\":\"dqxtbjwgnyf\"},\"state\":\"Restricted\",\"systemId\":\"uik\",\"tags\":{\"cfhmlrqryxyn\":\"jqg\",\"ptgoeiybbabp\":\"nzrdpsovwxz\"},\"targetCloud\":\"USGov\"},\"id\":\"f\",\"name\":\"lkvn\",\"type\":\"jlrigjkskyrioovz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InvoiceSection response = - manager - .invoiceSections() - .createOrUpdate( - "rtle", - "pqxbkwvzgnzvdf", - "zdix", - new InvoiceSectionInner() - .withDisplayName("pnodawopqhe") - .withLabels( - mapOf( - "bostzel", - "tmcg", - "tmzlbiojlv", - "dlat", - "r", - "hrbbpneqvcwwyy", - "nmokayzejnhlbk", - "ochpprpr")) - .withTags( - mapOf( - "chndbnwie", - "zv", - "ubwefqs", - "olewjwi", - "qtferrqwexjkmf", - "ap", - "btqwpwyawbzas", - "apjwogqqnobpudcd")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fqwazlnqnmcjn", response.displayName()); - Assertions.assertEquals("dqxtbjwgnyf", response.labels().get("sf")); - Assertions.assertEquals("jqg", response.tags().get("cfhmlrqryxyn")); - } - - @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/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.java deleted file mode 100644 index 0581a11f2959..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoiceSectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"cysihs\",\"labels\":{\"cohdx\":\"wdhohsdtmcdzsu\"},\"state\":\"Active\",\"systemId\":\"cmuapcvhd\",\"tags\":{\"qzinkfkbg\":\"wqqxeysko\"},\"targetCloud\":\"USSec\"},\"id\":\"owxeqocljmy\",\"name\":\"vkzqk\",\"type\":\"jeokbzefezrxccz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InvoiceSection response = - manager - .invoiceSections() - .getWithResponse("jtotpvopvpbd", "zq", "qqihedsvqwthmk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("cysihs", response.displayName()); - Assertions.assertEquals("wdhohsdtmcdzsu", response.labels().get("cohdx")); - Assertions.assertEquals("wqqxeysko", response.tags().get("qzinkfkbg")); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.java deleted file mode 100644 index 0c7e9835ee1f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoiceSectionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"ehjku\",\"labels\":{\"aeylinm\":\"afgaoqlt\",\"irpghriypoqeyh\":\"gv\"},\"state\":\"Active\",\"systemId\":\"kprlpyznuc\",\"tags\":{\"xtyasiibmiyb\":\"smexiitdf\",\"mgixhcmavmqfou\":\"nustgnljh\",\"cgyypro\":\"or\"},\"targetCloud\":\"USNat\"},\"id\":\"pundmbxhug\",\"name\":\"mjkavlgorbmft\",\"type\":\"mdtzfjltfvnzc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .invoiceSections() - .listByBillingProfile("eebtijvacvb", "qzbqqxlajrnwxa", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ehjku", response.iterator().next().displayName()); - Assertions.assertEquals("afgaoqlt", response.iterator().next().labels().get("aeylinm")); - Assertions.assertEquals("smexiitdf", response.iterator().next().tags().get("xtyasiibmiyb")); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.java deleted file mode 100644 index 75be29ddfc0c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpand; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InvoiceSectionsOnExpandTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionsOnExpand model = - BinaryData - .fromString( - "{\"hasMoreResults\":false,\"value\":[{\"properties\":{\"displayName\":\"ozwyiftyhxhuro\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"olniwpwcukjf\",\"tags\":{},\"targetCloud\":\"USNat\"},\"id\":\"w\",\"name\":\"klryplwck\",\"type\":\"asy\"},{\"properties\":{\"displayName\":\"ddhsgcbacphe\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"nqgoulzndli\",\"tags\":{},\"targetCloud\":\"USSec\"},\"id\":\"kgfg\",\"name\":\"bmadgak\",\"type\":\"qsrxybzqqed\"},{\"properties\":{\"displayName\":\"bciqfouflm\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"modmglougpb\",\"tags\":{},\"targetCloud\":\"USNat\"},\"id\":\"utduqktapspwgcu\",\"name\":\"rtumkdosvq\",\"type\":\"hbmdgbbjfdd\"},{\"properties\":{\"displayName\":\"mbe\",\"labels\":{},\"state\":\"Restricted\",\"systemId\":\"tq\",\"tags\":{},\"targetCloud\":\"USGov\"},\"id\":\"fpfpsalgbquxigj\",\"name\":\"jgzjaoyfhrtx\",\"type\":\"lnerkujysvleju\"}]}") - .toObject(InvoiceSectionsOnExpand.class); - Assertions.assertEquals("ozwyiftyhxhuro", model.value().get(0).displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionsOnExpand model = - new InvoiceSectionsOnExpand() - .withValue( - Arrays - .asList( - new InvoiceSectionInner() - .withDisplayName("ozwyiftyhxhuro") - .withLabels(mapOf()) - .withTags(mapOf()), - new InvoiceSectionInner() - .withDisplayName("ddhsgcbacphe") - .withLabels(mapOf()) - .withTags(mapOf()), - new InvoiceSectionInner() - .withDisplayName("bciqfouflm") - .withLabels(mapOf()) - .withTags(mapOf()), - new InvoiceSectionInner().withDisplayName("mbe").withLabels(mapOf()).withTags(mapOf()))); - model = BinaryData.fromObject(model).toObject(InvoiceSectionsOnExpand.class); - Assertions.assertEquals("ozwyiftyhxhuro", model.value().get(0).displayName()); - } - - @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/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.java deleted file mode 100644 index 89163085ad55..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadBillingSubscriptionInvoiceMockTests { - @Test - public void testDownloadBillingSubscriptionInvoice() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-05-25T20:54:06Z\",\"url\":\"knbnxwcdommpvfq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager - .invoices() - .downloadBillingSubscriptionInvoice("patlbijp", "gsksrfhf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.java deleted file mode 100644 index 655048e66218..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadInvoiceMockTests { - @Test - public void testDownloadInvoice() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-01-09T20:20:26Z\",\"url\":\"cbbxigdhxi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager.invoices().downloadInvoice("wjqo", "ueayfbpcmsplb", "rrueqthwmg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.java deleted file mode 100644 index 7b8f4aaa50b6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadMultipleBillingProfileInvoicesMockTests { - @Test - public void testDownloadMultipleBillingProfileInvoices() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-02-22T15:43:03Z\",\"url\":\"acigel\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager - .invoices() - .downloadMultipleBillingProfileInvoices( - "d", Arrays.asList("pedbwdpyqy", "bxubmdna", "cbq", "remj"), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.java deleted file mode 100644 index b8e788b9f2d2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests { - @Test - public void testDownloadMultipleBillingSubscriptionInvoices() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-05-24T19:47:23Z\",\"url\":\"swmtxk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager - .invoices() - .downloadMultipleBillingSubscriptionInvoices( - Arrays.asList("zfgbrttuiaclkie", "hajlfn", "hiqfyuttdiy", "b"), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java deleted file mode 100644 index d285663dbb82..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesGetByIdWithResponseMockTests { - @Test - public void testGetByIdWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dueDate\":\"2021-11-19T08:57:11Z\",\"invoiceDate\":\"2021-09-29T20:15:12Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"cyl\",\"value\":51.22294},\"azurePrepaymentApplied\":{\"currency\":\"sghpx\",\"value\":30.83282},\"billedAmount\":{\"currency\":\"rwjjkhvyomacluzv\",\"value\":40.415318},\"creditAmount\":{\"currency\":\"rpqpd\",\"value\":59.6452},\"freeAzureCreditApplied\":{\"currency\":\"isqcssffxuifmcs\",\"value\":69.43647},\"subTotal\":{\"currency\":\"dqzrdzsyloll\",\"value\":10.311211},\"taxAmount\":{\"currency\":\"zydmxzjijpvuaurk\",\"value\":11.588705},\"totalAmount\":{\"currency\":\"ldefxrdcoxn\",\"value\":32.83848},\"invoicePeriodStartDate\":\"2021-07-04T07:58:23Z\",\"invoicePeriodEndDate\":\"2021-04-25T04:45:39Z\",\"invoiceType\":\"AzureMarketplace\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"nqbpi\",\"billingProfileDisplayName\":\"qltgrd\",\"purchaseOrderNumber\":\"ypxrx\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"tafsrbxrblmliowx\",\"creditForDocumentId\":\"spnxwqagnepzw\",\"subscriptionId\":\"lsbs\"},\"id\":\"qqqagwwrxaomzi\",\"name\":\"glrrczez\",\"type\":\"hhltnjadhqo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Invoice response = - manager.invoices().getByIdWithResponse("xtwbta", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.java deleted file mode 100644 index 5da61106e83d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests { - @Test - public void testGetBySubscriptionAndInvoiceIdWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dueDate\":\"2021-10-03T14:21:22Z\",\"invoiceDate\":\"2021-02-27T09:08:37Z\",\"status\":\"Void\",\"amountDue\":{\"currency\":\"py\",\"value\":83.36014},\"azurePrepaymentApplied\":{\"currency\":\"eblydyv\",\"value\":47.9007},\"billedAmount\":{\"currency\":\"ocxnehvsmtodl\",\"value\":57.823967},\"creditAmount\":{\"currency\":\"ucygvo\",\"value\":34.292477},\"freeAzureCreditApplied\":{\"currency\":\"ssxlghieegjlg\",\"value\":45.138866},\"subTotal\":{\"currency\":\"eksgbuxantuygd\",\"value\":8.260214},\"taxAmount\":{\"currency\":\"pirpiwrqof\",\"value\":3.015864},\"totalAmount\":{\"currency\":\"jnlex\",\"value\":70.006035},\"invoicePeriodStartDate\":\"2021-09-02T12:37:37Z\",\"invoicePeriodEndDate\":\"2021-03-18T11:37:29Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"uuuercta\",\"billingProfileDisplayName\":\"yintqpbrlcy\",\"purchaseOrderNumber\":\"uczkgofxyfsruc\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"st\",\"creditForDocumentId\":\"eaqnrmvvfkoxm\",\"subscriptionId\":\"hktuidvrma\"},\"id\":\"lpdwwexymzvlazi\",\"name\":\"bhpwvqsgnyy\",\"type\":\"uzivensrpmeyyvp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Invoice response = - manager - .invoices() - .getBySubscriptionAndInvoiceIdWithResponse("zfrgqhaohcm", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.java deleted file mode 100644 index e3e1213c3c0c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dueDate\":\"2021-03-09T19:20:38Z\",\"invoiceDate\":\"2021-03-12T02:37:11Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"efjokn\",\"value\":76.97374},\"azurePrepaymentApplied\":{\"currency\":\"qedikdfrd\",\"value\":26.596153},\"billedAmount\":{\"currency\":\"jgeihfqlggwfi\",\"value\":70.12909},\"creditAmount\":{\"currency\":\"jpbyephmgtv\",\"value\":89.511314},\"freeAzureCreditApplied\":{\"currency\":\"m\",\"value\":27.577436},\"subTotal\":{\"currency\":\"gxhnpomyqwcabv\",\"value\":19.589584},\"taxAmount\":{\"currency\":\"ey\",\"value\":95.847664},\"totalAmount\":{\"currency\":\"augmrmfjlr\",\"value\":87.45515},\"invoicePeriodStartDate\":\"2021-07-12T07:37Z\",\"invoicePeriodEndDate\":\"2021-02-10T01:38:52Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"isizm\",\"billingProfileDisplayName\":\"eds\",\"purchaseOrderNumber\":\"wuived\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"qbpsmg\",\"creditForDocumentId\":\"guamlj\",\"subscriptionId\":\"rgmsplzga\"},\"id\":\"fcshh\",\"name\":\"new\",\"type\":\"nxkympqanxrjk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Invoice response = - manager - .invoices() - .getWithResponse("ubkmifo", "xkubvphavpmhbrbq", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java deleted file mode 100644 index c42f3402475e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dueDate\":\"2021-03-06T18:23Z\",\"invoiceDate\":\"2021-04-24T06:39:06Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"bbmpxdlvykfre\",\"value\":84.02913},\"azurePrepaymentApplied\":{\"currency\":\"qwjksghudgz\",\"value\":94.31504},\"billedAmount\":{\"currency\":\"ggsvoujkxibdaf\",\"value\":84.80425},\"creditAmount\":{\"currency\":\"yomkxfbvfbhdy\",\"value\":93.879715},\"freeAzureCreditApplied\":{\"currency\":\"pgddeimawz\",\"value\":66.26469},\"subTotal\":{\"currency\":\"um\",\"value\":96.09336},\"taxAmount\":{\"currency\":\"jcazt\",\"value\":72.1469},\"totalAmount\":{\"currency\":\"qowxwcom\",\"value\":43.389618},\"invoicePeriodStartDate\":\"2020-12-30T18:43:22Z\",\"invoicePeriodEndDate\":\"2021-05-14T17:01:32Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"k\",\"billingProfileDisplayName\":\"ve\",\"purchaseOrderNumber\":\"fdv\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"gddpq\",\"creditForDocumentId\":\"ehnmnaoyankco\",\"subscriptionId\":\"swankltytmh\"},\"id\":\"roznnhdrlktgj\",\"name\":\"sggux\",\"type\":\"eml\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .invoices() - .listByBillingAccount( - "wskondcbrwimuvqe", "osovyrrleaesin", "qtljqobbpihehc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java deleted file mode 100644 index 147b24ce0312..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dueDate\":\"2020-12-27T08:21:28Z\",\"invoiceDate\":\"2021-09-25T19:32:22Z\",\"status\":\"Due\",\"amountDue\":{\"currency\":\"owx\",\"value\":91.388405},\"azurePrepaymentApplied\":{\"currency\":\"deugf\",\"value\":16.688908},\"billedAmount\":{\"currency\":\"paxwkufyk\",\"value\":29.66174},\"creditAmount\":{\"currency\":\"epmrut\",\"value\":97.59715},\"freeAzureCreditApplied\":{\"currency\":\"obns\",\"value\":77.23243},\"subTotal\":{\"currency\":\"ltymkmvguihywart\",\"value\":92.43603},\"taxAmount\":{\"currency\":\"ixkykxd\",\"value\":5.8867693},\"totalAmount\":{\"currency\":\"mmuc\",\"value\":52.700138},\"invoicePeriodStartDate\":\"2021-11-27T23:37:26Z\",\"invoicePeriodEndDate\":\"2021-02-28T12:10:12Z\",\"invoiceType\":\"AzureMarketplace\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"yincql\",\"billingProfileDisplayName\":\"isws\",\"purchaseOrderNumber\":\"iiiovgqcgxuugq\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"teqdptj\",\"creditForDocumentId\":\"dtguk\",\"subscriptionId\":\"nblwphqlkcc\"},\"id\":\"zgygqwahoiulwgni\",\"name\":\"prglvawuwzduf\",\"type\":\"pivlsbbjpm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .invoices() - .listByBillingProfile( - "ywaeeczgf", "ukklelss", "blycsxzujksr", "smdesqplpvmjcd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.java deleted file mode 100644 index 349b66ca4044..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesListByBillingSubscriptionMockTests { - @Test - public void testListByBillingSubscription() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dueDate\":\"2021-11-02T12:37:58Z\",\"invoiceDate\":\"2021-06-07T05:32:23Z\",\"status\":\"OverDue\",\"amountDue\":{\"currency\":\"eakxcptsoqfyi\",\"value\":5.842119},\"azurePrepaymentApplied\":{\"currency\":\"hkrttzrazis\",\"value\":36.422657},\"billedAmount\":{\"currency\":\"emv\",\"value\":71.442566},\"creditAmount\":{\"currency\":\"ohmn\",\"value\":47.251976},\"freeAzureCreditApplied\":{\"currency\":\"ojklin\",\"value\":55.43031},\"subTotal\":{\"currency\":\"ysprq\",\"value\":92.47625},\"taxAmount\":{\"currency\":\"ojpslsvjgpliufi\",\"value\":76.19769},\"totalAmount\":{\"currency\":\"qvapcohhoucq\",\"value\":7.474506},\"invoicePeriodStartDate\":\"2021-09-24T10:14:03Z\",\"invoicePeriodEndDate\":\"2021-03-15T00:35:26Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"gdzbenr\",\"billingProfileDisplayName\":\"cawetzqddt\",\"purchaseOrderNumber\":\"fljhznamtua\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"tjzmi\",\"creditForDocumentId\":\"gbgatzuuvbxn\",\"subscriptionId\":\"ebwgga\"},\"id\":\"ttzlswvajqfutlx\",\"name\":\"oqza\",\"type\":\"unwqr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.invoices().listByBillingSubscription("ohdbvqvwzkj", "pwbeonr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.java deleted file mode 100644 index 56546760cf4a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"bcporxvxcjzhqizx\",\"resource\":\"xtgqscjavftjuh\",\"operation\":\"azkmtgguwp\",\"description\":\"r\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.java deleted file mode 100644 index 2f44532627a6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.OperationInner; -import com.azure.resourcemanager.billing.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"ethwwnpjhlfz\",\"isDataAction\":false,\"display\":{\"provider\":\"wahfbousnfepgfew\",\"resource\":\"wlyxgncxyk\",\"operation\":\"djhlimm\",\"description\":\"x\"}}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.java deleted file mode 100644 index fa9010f7ac70..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"ihhrmo\",\"isDataAction\":false,\"display\":{\"provider\":\"eypxiutcxapzhyr\",\"resource\":\"togebjoxsl\",\"operation\":\"nhl\",\"description\":\"rqnkkzjcjbtr\"}},{\"name\":\"ehvvib\",\"isDataAction\":false,\"display\":{\"provider\":\"toqbeitpkxztmoob\",\"resource\":\"ft\",\"operation\":\"gfcwqmpimaqxzhem\",\"description\":\"h\"}},{\"name\":\"uj\",\"isDataAction\":false,\"display\":{\"provider\":\"ozzwculkba\",\"resource\":\"fajnjwltlwtjjguk\",\"operation\":\"lhsnvkcdmx\",\"description\":\"poaimlnwiaaomyl\"}}],\"nextLink\":\"azul\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java deleted file mode 100644 index 02a882f85dc7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"umqy\",\"isDataAction\":true,\"display\":{\"provider\":\"ulodsaeuzanhsfnh\",\"resource\":\"nwph\",\"operation\":\"fngq\",\"description\":\"lidftujwjj\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.java deleted file mode 100644 index 09dd454de703..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.Participants; - -public final class ParticipantsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Participants model = - BinaryData - .fromString("{\"status\":\"ork\",\"statusDate\":\"2021-07-22T12:33Z\",\"email\":\"wjhhgdnhxmsivf\"}") - .toObject(Participants.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Participants model = new Participants(); - model = BinaryData.fromObject(model).toObject(Participants.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.java deleted file mode 100644 index 062643f36523..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.PaymentMethodFamily; -import com.azure.resourcemanager.billing.models.PaymentProperties; -import org.junit.jupiter.api.Assertions; - -public final class PaymentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PaymentProperties model = - BinaryData - .fromString( - "{\"paymentType\":\"tvb\",\"amount\":{\"currency\":\"sfraoyzko\",\"value\":32.20966},\"date\":\"2021-01-01T04:06:13Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"xawqaldsyuuxim\"}") - .toObject(PaymentProperties.class); - Assertions.assertEquals(PaymentMethodFamily.NONE, model.paymentMethodFamily()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PaymentProperties model = new PaymentProperties().withPaymentMethodFamily(PaymentMethodFamily.NONE); - model = BinaryData.fromObject(model).toObject(PaymentProperties.class); - Assertions.assertEquals(PaymentMethodFamily.NONE, model.paymentMethodFamily()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java deleted file mode 100644 index a556286330e9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -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; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesGetByBillingProfileWithResponseMockTests { - @Test - public void testGetByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"marketplacePurchases\":\"AllAllowed\",\"reservationPurchases\":\"NotAllowed\",\"viewCharges\":\"Allowed\"},\"id\":\"b\",\"name\":\"qkyojwyvf\",\"type\":\"mbtsuahxsg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Policy response = - manager - .policies() - .getByBillingProfileWithResponse("oqbvjhvefgwbmqj", "hntasfaymx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(MarketplacePurchasesPolicy.ALL_ALLOWED, response.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, response.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.java deleted file mode 100644 index 3872fd503387..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.CustomerPolicy; -import com.azure.resourcemanager.billing.models.ViewCharges; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesGetByCustomerWithResponseMockTests { - @Test - public void testGetByCustomerWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"viewCharges\":\"Allowed\"},\"id\":\"skbruffgllukkut\",\"name\":\"lxhrp\",\"type\":\"hvmblcouqehbhbc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomerPolicy response = - manager - .policies() - .getByCustomerWithResponse("ttxpnrupza", "mrdixtreki", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ViewCharges.ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.java deleted file mode 100644 index 6d2e47ba2e62..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.models.CustomerPolicy; -import com.azure.resourcemanager.billing.models.ViewCharges; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesUpdateCustomerWithResponseMockTests { - @Test - public void testUpdateCustomerWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"viewCharges\":\"Allowed\"},\"id\":\"zyqegxyiv\",\"name\":\"inbmh\",\"type\":\"bjijkgqxnh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomerPolicy response = - manager - .policies() - .updateCustomerWithResponse( - "sziryrandoyp", - "blto", - new CustomerPolicyInner().withViewCharges(ViewCharges.ALLOWED), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ViewCharges.ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java deleted file mode 100644 index 5a2335069d8c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -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; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"marketplacePurchases\":\"NotAllowed\",\"reservationPurchases\":\"Allowed\",\"viewCharges\":\"NotAllowed\"},\"id\":\"pol\",\"name\":\"t\",\"type\":\"evboclzhzjknyuxg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Policy response = - manager - .policies() - .updateWithResponse( - "jcmmzrrscub", - "wsdrnpxqwodif", - new PolicyInner() - .withMarketplacePurchases(MarketplacePurchasesPolicy.NOT_ALLOWED) - .withReservationPurchases(ReservationPurchasesPolicy.NOT_ALLOWED) - .withViewCharges(ViewChargesPolicy.NOT_ALLOWED), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(MarketplacePurchasesPolicy.NOT_ALLOWED, response.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.ALLOWED, response.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.NOT_ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.java deleted file mode 100644 index 19cd4f1e5d2f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.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.generated; - -import com.azure.core.util.BinaryData; -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; -import org.junit.jupiter.api.Assertions; - -public final class PolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PolicyInner model = - BinaryData - .fromString( - "{\"properties\":{\"marketplacePurchases\":\"AllAllowed\",\"reservationPurchases\":\"NotAllowed\",\"viewCharges\":\"Allowed\"},\"id\":\"joqrvqqaatj\",\"name\":\"nrvgoupmfiibfgg\",\"type\":\"ioolvrwxkvtkkgll\"}") - .toObject(PolicyInner.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ALL_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PolicyInner model = - new PolicyInner() - .withMarketplacePurchases(MarketplacePurchasesPolicy.ALL_ALLOWED) - .withReservationPurchases(ReservationPurchasesPolicy.NOT_ALLOWED) - .withViewCharges(ViewChargesPolicy.ALLOWED); - model = BinaryData.fromObject(model).toObject(PolicyInner.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ALL_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.java deleted file mode 100644 index d0a8201e40a4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.PolicyProperties; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import org.junit.jupiter.api.Assertions; - -public final class PolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PolicyProperties model = - BinaryData - .fromString( - "{\"marketplacePurchases\":\"OnlyFreeAllowed\",\"reservationPurchases\":\"NotAllowed\",\"viewCharges\":\"NotAllowed\"}") - .toObject(PolicyProperties.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ONLY_FREE_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.NOT_ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PolicyProperties model = - new PolicyProperties() - .withMarketplacePurchases(MarketplacePurchasesPolicy.ONLY_FREE_ALLOWED) - .withReservationPurchases(ReservationPurchasesPolicy.NOT_ALLOWED) - .withViewCharges(ViewChargesPolicy.NOT_ALLOWED); - model = BinaryData.fromObject(model).toObject(PolicyProperties.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ONLY_FREE_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.NOT_ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.java deleted file mode 100644 index 1e1a66b9dd56..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import org.junit.jupiter.api.Assertions; - -public final class ProductInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductInner model = - BinaryData - .fromString( - "{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"vithh\",\"purchaseDate\":\"2021-10-25T20:46:01Z\",\"productTypeId\":\"osggbhc\",\"productType\":\"fwdsj\",\"status\":\"Disabled\",\"endDate\":\"2021-06-21T07:46:59Z\",\"billingFrequency\":\"Monthly\",\"lastCharge\":{\"currency\":\"swacffgdkzz\",\"value\":79.305},\"lastChargeDate\":\"2021-09-11T04:06:27Z\",\"quantity\":91.20859,\"skuId\":\"railvpnppfuf\",\"skuDescription\":\"wdmhdlxyjrxs\",\"tenantId\":\"afcnih\",\"availabilityId\":\"qapnedgfbcv\",\"invoiceSectionId\":\"vq\",\"invoiceSectionDisplayName\":\"keqdcvdrhvoods\",\"billingProfileId\":\"bobzdopcjwvnhd\",\"billingProfileDisplayName\":\"wmgxcxrsl\",\"customerId\":\"utwu\",\"customerDisplayName\":\"grpkhjwniyqs\",\"reseller\":{\"resellerId\":\"cpdggkzzlvmbmp\",\"description\":\"modfvuefywsbpfvm\"}},\"id\":\"yhrfouyftaakcpw\",\"name\":\"yzvqt\",\"type\":\"nubexk\"}") - .toObject(ProductInner.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, model.status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, model.billingFrequency()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductInner model = - new ProductInner() - .withAutoRenew(AutoRenew.OFF) - .withStatus(ProductStatusType.DISABLED) - .withBillingFrequency(BillingFrequency.MONTHLY); - model = BinaryData.fromObject(model).toObject(ProductInner.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, model.status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, model.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.java deleted file mode 100644 index 7b3f18ebafa0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ProductProperties; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import org.junit.jupiter.api.Assertions; - -public final class ProductPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductProperties model = - BinaryData - .fromString( - "{\"autoRenew\":\"Off\",\"displayName\":\"mond\",\"purchaseDate\":\"2021-04-01T23:21:50Z\",\"productTypeId\":\"xvy\",\"productType\":\"mg\",\"status\":\"Expired\",\"endDate\":\"2021-02-23T14:11:02Z\",\"billingFrequency\":\"OneTime\",\"lastCharge\":{\"currency\":\"pajqgxysm\",\"value\":44.408627},\"lastChargeDate\":\"2021-03-21T23:12:31Z\",\"quantity\":40.273422,\"skuId\":\"mkcxozapvh\",\"skuDescription\":\"xprglyatddc\",\"tenantId\":\"bcuejrjxgci\",\"availabilityId\":\"brh\",\"invoiceSectionId\":\"xsdqrhzoymibmrqy\",\"invoiceSectionDisplayName\":\"ahwfluszdtmhrk\",\"billingProfileId\":\"fyyvoq\",\"billingProfileDisplayName\":\"piexpbtgiw\",\"customerId\":\"oenwashr\",\"customerDisplayName\":\"tkcnqxwb\",\"reseller\":{\"resellerId\":\"ulpiuj\",\"description\":\"asipqiio\"}}") - .toObject(ProductProperties.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.EXPIRED, model.status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, model.billingFrequency()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductProperties model = - new ProductProperties() - .withAutoRenew(AutoRenew.OFF) - .withStatus(ProductStatusType.EXPIRED) - .withBillingFrequency(BillingFrequency.ONE_TIME); - model = BinaryData.fromObject(model).toObject(ProductProperties.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.EXPIRED, model.status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, model.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java deleted file mode 100644 index aad416840ba2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -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 java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"oxoyyukp\",\"purchaseDate\":\"2021-02-08T12:14:50Z\",\"productTypeId\":\"oir\",\"productType\":\"boshbragapyyrmfs\",\"status\":\"PastDue\",\"endDate\":\"2020-12-22T03:30:36Z\",\"billingFrequency\":\"UsageBased\",\"lastCharge\":{\"currency\":\"ppdbwnupgahxkum\",\"value\":87.27331},\"lastChargeDate\":\"2021-05-10T22:23:02Z\",\"quantity\":87.1412,\"skuId\":\"dmmcpugmehqep\",\"skuDescription\":\"fhbzehewhoqhn\",\"tenantId\":\"qnbldxe\",\"availabilityId\":\"lgsc\",\"invoiceSectionId\":\"ri\",\"invoiceSectionDisplayName\":\"rsrrmoucsofldp\",\"billingProfileId\":\"iyfc\",\"billingProfileDisplayName\":\"beolh\",\"customerId\":\"lvbmxuqibsxtkcu\",\"customerDisplayName\":\"b\",\"reseller\":{\"resellerId\":\"rfsiowlkjxn\",\"description\":\"vwgf\"}},\"id\":\"tmhqykiz\",\"name\":\"d\",\"type\":\"saoafcluqvox\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .getWithResponse("ibidmhmwffp", "fmuvapckccr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoRenew.ON, response.autoRenew()); - Assertions.assertEquals(ProductStatusType.PAST_DUE, response.status()); - Assertions.assertEquals(BillingFrequency.USAGE_BASED, response.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.java deleted file mode 100644 index c49fbed294b1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -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 java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"gdirazf\",\"purchaseDate\":\"2021-02-11T05:39:41Z\",\"productTypeId\":\"w\",\"productType\":\"mdujtmvcopexcm\",\"status\":\"Expiring\",\"endDate\":\"2021-03-26T03:28:17Z\",\"billingFrequency\":\"Monthly\",\"lastCharge\":{\"currency\":\"yqltqsro\",\"value\":83.38941},\"lastChargeDate\":\"2020-12-26T17:33:42Z\",\"quantity\":94.9375,\"skuId\":\"jk\",\"skuDescription\":\"ysidfvclgl\",\"tenantId\":\"fuijtkbus\",\"availabilityId\":\"gsfikayiansha\",\"invoiceSectionId\":\"jtjiqx\",\"invoiceSectionDisplayName\":\"yjqtt\",\"billingProfileId\":\"kpqhjpenuygbq\",\"billingProfileDisplayName\":\"qekewvnqvcd\",\"customerId\":\"uaucmf\",\"customerDisplayName\":\"wnlaxpu\",\"reseller\":{\"resellerId\":\"ikczvvitacgxmf\",\"description\":\"serxht\"}},\"id\":\"soxhlwntsjgqr\",\"name\":\"xypruuuy\",\"type\":\"nchrszizoyu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().listByBillingAccount("hrtdtpdelq", "cslmotoebnfxo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.OFF, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.EXPIRING, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.java deleted file mode 100644 index e62ce259b547..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -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 java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"hzjmucftbyrp\",\"purchaseDate\":\"2020-12-22T05:32:19Z\",\"productTypeId\":\"kpigqfusu\",\"productType\":\"zmkw\",\"status\":\"Disabled\",\"endDate\":\"2021-04-09T11:30:43Z\",\"billingFrequency\":\"OneTime\",\"lastCharge\":{\"currency\":\"qe\",\"value\":32.821198},\"lastChargeDate\":\"2021-08-08T18:00:09Z\",\"quantity\":15.188092,\"skuId\":\"gwydyy\",\"skuDescription\":\"svkhgbv\",\"tenantId\":\"anarfdlpukhpyrne\",\"availabilityId\":\"jcpeogkhnmg\",\"invoiceSectionId\":\"ouxddbhfhpfpazj\",\"invoiceSectionDisplayName\":\"ywjxh\",\"billingProfileId\":\"ulontacnpqwteht\",\"billingProfileDisplayName\":\"vrh\",\"customerId\":\"jyoogwxh\",\"customerDisplayName\":\"duugwbsre\",\"reseller\":{\"resellerId\":\"q\",\"description\":\"uarenlv\"}},\"id\":\"htkln\",\"name\":\"nafvvkyfedev\",\"type\":\"bo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().listByBillingProfile("lyetndnbfqygg", "g", "lnlg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.ON, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.java deleted file mode 100644 index c9f5b3365199..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -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 java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByCustomerMockTests { - @Test - public void testListByCustomer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"ttgepuslvyjtcv\",\"purchaseDate\":\"2021-03-17T17:29:52Z\",\"productTypeId\":\"s\",\"productType\":\"iesfuug\",\"status\":\"PastDue\",\"endDate\":\"2021-02-18T13:25:08Z\",\"billingFrequency\":\"Monthly\",\"lastCharge\":{\"currency\":\"ey\",\"value\":19.2963},\"lastChargeDate\":\"2021-10-11T19:18:51Z\",\"quantity\":8.290726,\"skuId\":\"buew\",\"skuDescription\":\"s\",\"tenantId\":\"jlxuz\",\"availabilityId\":\"wpusxjbaqehg\",\"invoiceSectionId\":\"ohzjqatucoigeb\",\"invoiceSectionDisplayName\":\"cnwfepbnwgfmxjg\",\"billingProfileId\":\"bjb\",\"billingProfileDisplayName\":\"lfgtdysnaquflqbc\",\"customerId\":\"hamzjrwdkqze\",\"customerDisplayName\":\"jleziunjx\",\"reseller\":{\"resellerId\":\"antkwcegyamlbns\",\"description\":\"ac\"}},\"id\":\"jvpilguooqja\",\"name\":\"m\",\"type\":\"itgueiookjbs\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().listByCustomer("r", "cq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.ON, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.PAST_DUE, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java deleted file mode 100644 index cedf6d070598..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -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 java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"vudb\",\"purchaseDate\":\"2021-10-09T01:41:08Z\",\"productTypeId\":\"tvq\",\"productType\":\"rqctmxxdtdd\",\"status\":\"Cancelled\",\"endDate\":\"2021-05-15T03:50:17Z\",\"billingFrequency\":\"OneTime\",\"lastCharge\":{\"currency\":\"vtzn\",\"value\":64.74098},\"lastChargeDate\":\"2021-11-27T23:17:15Z\",\"quantity\":21.243965,\"skuId\":\"vvoxczytprwnw\",\"skuDescription\":\"oevytlyokr\",\"tenantId\":\"o\",\"availabilityId\":\"xv\",\"invoiceSectionId\":\"asbcrymodizrx\",\"invoiceSectionDisplayName\":\"obdxnazpmkmlm\",\"billingProfileId\":\"vfxzopjh\",\"billingProfileDisplayName\":\"xliohrdddt\",\"customerId\":\"xqbawpc\",\"customerDisplayName\":\"nzqcy\",\"reseller\":{\"resellerId\":\"p\",\"description\":\"fyuicdh\"}},\"id\":\"bd\",\"name\":\"bwwg\",\"type\":\"d\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .products() - .listByInvoiceSection("lcqxypokk", "minqcym", "zng", "bdxxe", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.OFF, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.CANCELLED, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.java deleted file mode 100644 index 8aef8638de8f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.ProductsListResult; - -public final class ProductsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"rn\",\"purchaseDate\":\"2021-01-14T16:52:07Z\",\"productTypeId\":\"q\",\"productType\":\"hxcr\",\"status\":\"PastDue\",\"endDate\":\"2021-11-28T02:47:56Z\",\"billingFrequency\":\"OneTime\",\"lastChargeDate\":\"2021-03-25T00:29:47Z\",\"quantity\":52.194805,\"skuId\":\"hsqfsubcgjbirxbp\",\"skuDescription\":\"srfbjfdtwss\",\"tenantId\":\"ftpvjzbexil\",\"availabilityId\":\"nfqqnvwp\",\"invoiceSectionId\":\"taruoujmkcj\",\"invoiceSectionDisplayName\":\"qytjrybnwjewgd\",\"billingProfileId\":\"ervnaenqpehi\",\"billingProfileDisplayName\":\"oygmift\",\"customerId\":\"zdnds\",\"customerDisplayName\":\"nayqi\"},\"id\":\"nduhavhqlkthum\",\"name\":\"qolbgyc\",\"type\":\"uie\"},{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"y\",\"purchaseDate\":\"2021-01-19T22:33:55Z\",\"productTypeId\":\"l\",\"productType\":\"slqlfmmdn\",\"status\":\"Expired\",\"endDate\":\"2021-10-21T18:49:25Z\",\"billingFrequency\":\"Monthly\",\"lastChargeDate\":\"2021-11-30T08:30:44Z\",\"quantity\":76.70319,\"skuId\":\"wyhzdx\",\"skuDescription\":\"adbzmnvdfznud\",\"tenantId\":\"dvxzbncblylpst\",\"availabilityId\":\"hh\",\"invoiceSectionId\":\"rzdzucerscdnt\",\"invoiceSectionDisplayName\":\"vfiwjmygtdss\",\"billingProfileId\":\"wtmwerio\",\"billingProfileDisplayName\":\"pyqs\",\"customerId\":\"wab\",\"customerDisplayName\":\"tshhszhedp\"},\"id\":\"wiwubm\",\"name\":\"mbes\",\"type\":\"dnkwwtppjflcxog\"},{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"z\",\"purchaseDate\":\"2021-05-06T06:04:09Z\",\"productTypeId\":\"kvmkqzeqq\",\"productType\":\"l\",\"status\":\"Expired\",\"endDate\":\"2021-06-11T23:31:33Z\",\"billingFrequency\":\"OneTime\",\"lastChargeDate\":\"2021-01-04T21:57:35Z\",\"quantity\":1.5751779,\"skuId\":\"odkwobd\",\"skuDescription\":\"xtibqdxbxwakbog\",\"tenantId\":\"ndlkzgxhurip\",\"availabilityId\":\"podxunkb\",\"invoiceSectionId\":\"xmubyyntwlrbq\",\"invoiceSectionDisplayName\":\"oievseotgqrlltm\",\"billingProfileId\":\"lauwzizxbmpgcjef\",\"billingProfileDisplayName\":\"muvp\",\"customerId\":\"tdum\",\"customerDisplayName\":\"p\"},\"id\":\"ebmnzbtbhjpglk\",\"name\":\"gohdneuelfphsd\",\"type\":\"htozfikdow\"}],\"totalCount\":1185627072,\"nextLink\":\"v\"}") - .toObject(ProductsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductsListResult model = new ProductsListResult(); - model = BinaryData.fromObject(model).toObject(ProductsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.java deleted file mode 100644 index 802a72a859fa..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -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.TransferProductRequestProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsMoveWithResponseMockTests { - @Test - public void testMoveWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"xfzzzwyjafitlhgu\",\"purchaseDate\":\"2021-06-17T12:18:01Z\",\"productTypeId\":\"hlgmltxdwhmoz\",\"productType\":\"gzvlnsnn\",\"status\":\"Cancelled\",\"endDate\":\"2021-07-24T17:46:18Z\",\"billingFrequency\":\"UsageBased\",\"lastCharge\":{\"currency\":\"mwamxqzragpgdph\",\"value\":77.4531},\"lastChargeDate\":\"2021-04-17T05:54:10Z\",\"quantity\":30.930174,\"skuId\":\"lejchcsr\",\"skuDescription\":\"knmzlanrupdwvnp\",\"tenantId\":\"nzqtpjhmqrhvt\",\"availabilityId\":\"aiwdcxsmlzzhz\",\"invoiceSectionId\":\"xetlgydlhqv\",\"invoiceSectionDisplayName\":\"npxybafiq\",\"billingProfileId\":\"aarbgjekg\",\"billingProfileDisplayName\":\"lbyulidwcwvmze\",\"customerId\":\"o\",\"customerDisplayName\":\"hj\",\"reseller\":{\"resellerId\":\"gdn\",\"description\":\"brfkspz\"}},\"id\":\"zmtksjci\",\"name\":\"digsxcdgl\",\"type\":\"plkeuachtomflryt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .moveWithResponse( - "vhqjwtrhtgvg", - "pcrrk", - new TransferProductRequestProperties().withDestinationInvoiceSectionId("awjmjsmw"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoRenew.ON, response.autoRenew()); - Assertions.assertEquals(ProductStatusType.CANCELLED, response.status()); - Assertions.assertEquals(BillingFrequency.USAGE_BASED, response.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java deleted file mode 100644 index f374a04deaf2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -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 java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"etgbebjfulb\",\"purchaseDate\":\"2021-02-08T00:52:50Z\",\"productTypeId\":\"h\",\"productType\":\"pnfpubntnbat\",\"status\":\"Disabled\",\"endDate\":\"2021-05-10T12:36:54Z\",\"billingFrequency\":\"UsageBased\",\"lastCharge\":{\"currency\":\"aelcat\",\"value\":6.264615},\"lastChargeDate\":\"2021-05-25T09:31:16Z\",\"quantity\":37.74234,\"skuId\":\"vkmjcwmjvlgf\",\"skuDescription\":\"cvkyylizrzbj\",\"tenantId\":\"fxsfuztlvtmv\",\"availabilityId\":\"bwidql\",\"invoiceSectionId\":\"ukoveofi\",\"invoiceSectionDisplayName\":\"vjfn\",\"billingProfileId\":\"mvl\",\"billingProfileDisplayName\":\"z\",\"customerId\":\"blkujrllfojuidjp\",\"customerDisplayName\":\"yjucejikzoeo\",\"reseller\":{\"resellerId\":\"zejet\",\"description\":\"ln\"}},\"id\":\"ikyju\",\"name\":\"k\",\"type\":\"bqzolxr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .updateWithResponse( - "ycjimryvwgcwwpbm", - "gwe", - new ProductInner() - .withAutoRenew(AutoRenew.OFF) - .withStatus(ProductStatusType.CANCELLED) - .withBillingFrequency(BillingFrequency.ONE_TIME), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoRenew.OFF, response.autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, response.status()); - Assertions.assertEquals(BillingFrequency.USAGE_BASED, response.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.java deleted file mode 100644 index af86288f701c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.RebillDetails; - -public final class RebillDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RebillDetails model = - BinaryData - .fromString( - "{\"creditNoteDocumentId\":\"qfobwyz\",\"invoiceDocumentId\":\"bykutw\",\"rebillDetails\":{\"akgtdlmkkzevdlh\":{\"creditNoteDocumentId\":\"a\",\"invoiceDocumentId\":\"hrskdsnfd\",\"rebillDetails\":{}},\"akufgmjz\":{\"creditNoteDocumentId\":\"pusdstt\",\"invoiceDocumentId\":\"ogvbbejdcngq\",\"rebillDetails\":{}}}}") - .toObject(RebillDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RebillDetails model = new RebillDetails(); - model = BinaryData.fromObject(model).toObject(RebillDetails.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.java deleted file mode 100644 index 4a0330b58b17..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.Reseller; - -public final class ResellerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Reseller model = - BinaryData - .fromString("{\"resellerId\":\"gsxnkjzkdeslpv\",\"description\":\"pwiyig\"}") - .toObject(Reseller.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Reseller model = new Reseller(); - model = BinaryData.fromObject(model).toObject(Reseller.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.java deleted file mode 100644 index fdc06de7fa02..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ReservationInner; -import com.azure.resourcemanager.billing.models.ReservationSkuProperty; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationInner model = - BinaryData - .fromString( - "{\"id\":\"vdwxfzwi\",\"name\":\"wzjbh\",\"type\":\"sxjrk\",\"location\":\"btrnegvm\",\"sku\":{\"name\":\"q\"},\"properties\":{\"appliedScopes\":[\"dspastjbkkdmfl\"],\"appliedScopeType\":\"stmjlxrri\",\"reservedResourceType\":\"zapeewchpx\",\"quantity\":51.30364,\"provisioningState\":\"kuziycsle\",\"expiryDate\":\"f\",\"provisioningSubState\":\"tcktyhjtqedcgzu\",\"displayName\":\"mmrqz\",\"displayProvisioningState\":\"rjvpglydzgkrvqee\",\"userFriendlyRenewState\":\"oepry\",\"userFriendlyAppliedScopeType\":\"nwy\",\"effectiveDateTime\":\"zdmovzv\",\"skuDescription\":\"aawzqadfl\",\"term\":\"ur\",\"renew\":true,\"renewSource\":\"ecxn\",\"utilization\":{\"trend\":\"cokpv\",\"aggregates\":[]}}}") - .toObject(ReservationInner.class); - Assertions.assertEquals("dspastjbkkdmfl", model.appliedScopes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationInner model = - new ReservationInner() - .withSku(new ReservationSkuProperty()) - .withAppliedScopes(Arrays.asList("dspastjbkkdmfl")); - model = BinaryData.fromObject(model).toObject(ReservationInner.class); - Assertions.assertEquals("dspastjbkkdmfl", model.appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.java deleted file mode 100644 index c40bb2b085f5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ReservationProperty; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationProperty model = - BinaryData - .fromString( - "{\"appliedScopes\":[\"gxobfirclnp\",\"ciayzriykhya\",\"fvjlboxqvkjlmx\"],\"appliedScopeType\":\"mdy\",\"reservedResourceType\":\"dwdigumb\",\"quantity\":79.26031,\"provisioningState\":\"uzzptjazysdz\",\"expiryDate\":\"zwwva\",\"provisioningSubState\":\"yuvvfonkp\",\"displayName\":\"qyikvy\",\"displayProvisioningState\":\"uyav\",\"userFriendlyRenewState\":\"wmn\",\"userFriendlyAppliedScopeType\":\"ttijfybvpoekrs\",\"effectiveDateTime\":\"gbdhuzqgnjdg\",\"skuDescription\":\"nscliqhzvhxnk\",\"term\":\"tkubotppn\",\"renew\":false,\"renewSource\":\"xhihfrbbcevqagtl\",\"utilization\":{\"trend\":\"lfkqojpy\",\"aggregates\":[{\"grain\":71.06859,\"grainUnit\":\"cnifm\",\"value\":42.886497,\"valueUnit\":\"ymbrnysuxmpraf\"}]}}") - .toObject(ReservationProperty.class); - Assertions.assertEquals("gxobfirclnp", model.appliedScopes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationProperty model = - new ReservationProperty().withAppliedScopes(Arrays.asList("gxobfirclnp", "ciayzriykhya", "fvjlboxqvkjlmx")); - model = BinaryData.fromObject(model).toObject(ReservationProperty.class); - Assertions.assertEquals("gxobfirclnp", model.appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java deleted file mode 100644 index cfdbbf018576..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (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.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationPropertyUtilization; -import com.azure.resourcemanager.billing.models.ReservationUtilizationAggregates; -import java.util.Arrays; - -public final class ReservationPropertyUtilizationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationPropertyUtilization model = - BinaryData - .fromString( - "{\"trend\":\"ckh\",\"aggregates\":[{\"grain\":5.347806,\"grainUnit\":\"ffwafq\",\"value\":61.13735,\"valueUnit\":\"aspavehhr\"}]}") - .toObject(ReservationPropertyUtilization.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationPropertyUtilization model = - new ReservationPropertyUtilization().withAggregates(Arrays.asList(new ReservationUtilizationAggregates())); - model = BinaryData.fromObject(model).toObject(ReservationPropertyUtilization.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java deleted file mode 100644 index 8eb47537dc76..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (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.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationSkuProperty; - -public final class ReservationSkuPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationSkuProperty model = BinaryData.fromString("{\"name\":\"t\"}").toObject(ReservationSkuProperty.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSkuProperty model = new ReservationSkuProperty(); - model = BinaryData.fromObject(model).toObject(ReservationSkuProperty.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.java deleted file mode 100644 index fed07fadee2c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationSummary; - -public final class ReservationSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationSummary model = - BinaryData - .fromString( - "{\"succeededCount\":29.918415,\"failedCount\":93.61522,\"expiringCount\":44.341938,\"expiredCount\":23.334568,\"pendingCount\":75.85746,\"cancelledCount\":61.311485}") - .toObject(ReservationSummary.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSummary model = new ReservationSummary(); - model = BinaryData.fromObject(model).toObject(ReservationSummary.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.java deleted file mode 100644 index ed0430403c36..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationUtilizationAggregates; - -public final class ReservationUtilizationAggregatesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationUtilizationAggregates model = - BinaryData - .fromString("{\"grain\":55.157936,\"grainUnit\":\"n\",\"value\":42.470722,\"valueUnit\":\"dhcxgkmoy\"}") - .toObject(ReservationUtilizationAggregates.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationUtilizationAggregates model = new ReservationUtilizationAggregates(); - model = BinaryData.fromObject(model).toObject(ReservationUtilizationAggregates.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.java deleted file mode 100644 index dc7a22dea93f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Reservation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReservationsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"wpwerye\",\"name\":\"kdhmeottawjyosx\",\"type\":\"hnhjtfvpndpmi\",\"location\":\"pnwy\",\"sku\":{\"name\":\"qllzsauzpjlxeehu\"},\"properties\":{\"appliedScopes\":[\"zlrayme\",\"xls\",\"ihmxrfdsajredn\",\"yyshtuwgmevua\"],\"appliedScopeType\":\"wzyif\",\"reservedResourceType\":\"gwltxeqip\",\"quantity\":21.367962,\"provisioningState\":\"yimsfayorpr\",\"expiryDate\":\"kj\",\"provisioningSubState\":\"eslabnsmjkwynq\",\"displayName\":\"ekqsykvwjtqpkev\",\"displayProvisioningState\":\"ltjcrspxk\",\"userFriendlyRenewState\":\"r\",\"userFriendlyAppliedScopeType\":\"lfg\",\"effectiveDateTime\":\"nnnoytz\",\"skuDescription\":\"sewxigpxvkqm\",\"term\":\"pxvpifdfaif\",\"renew\":true,\"renewSource\":\"eyuubei\",\"utilization\":{\"trend\":\"l\",\"aggregates\":[]}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .reservations() - .listByBillingAccount( - "yqwixvcpwnkwywzw", - "falickduoiqtamty", - "sknxrwzawnvsbcf", - "zagxnvhycvdi", - "wrzregzgyufu", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zlrayme", response.iterator().next().appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.java deleted file mode 100644 index c4c6e8631ae3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Reservation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReservationsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"dnaienhqhskndnel\",\"name\":\"aadl\",\"type\":\"wf\",\"location\":\"nniyopetxi\",\"sku\":{\"name\":\"rl\"},\"properties\":{\"appliedScopes\":[\"caephbl\"],\"appliedScopeType\":\"qp\",\"reservedResourceType\":\"vbqsdt\",\"quantity\":63.41683,\"provisioningState\":\"tvivuzqym\",\"expiryDate\":\"owog\",\"provisioningSubState\":\"it\",\"displayName\":\"hzvb\",\"displayProvisioningState\":\"cdb\",\"userFriendlyRenewState\":\"fzndscxmxeatkd\",\"userFriendlyAppliedScopeType\":\"wnrdjyibqbnaom\",\"effectiveDateTime\":\"rmkuh\",\"skuDescription\":\"xljalfihc\",\"term\":\"obcancdexxqcw\",\"renew\":false,\"renewSource\":\"gvaknokzwjjzrl\",\"utilization\":{\"trend\":\"l\",\"aggregates\":[]}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .reservations() - .listByBillingProfile( - "toi", - "hgygvfltgvd", - "hoynk", - "xwetwkdrcyrucpc", - "nn", - "zdqumoe", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("caephbl", response.iterator().next().appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.java deleted file mode 100644 index 04fa82034225..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationSummary; -import com.azure.resourcemanager.billing.models.ReservationsListResult; - -public final class ReservationsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"ox\",\"name\":\"dufiq\",\"type\":\"ieuzaofjchvcyyy\",\"location\":\"gdotcubiipuipwo\",\"sku\":{\"name\":\"macjekn\"},\"properties\":{\"appliedScopes\":[],\"appliedScopeType\":\"qvci\",\"reservedResourceType\":\"ev\",\"quantity\":66.675064,\"provisioningState\":\"lrri\",\"expiryDate\":\"ywdxsmic\",\"provisioningSubState\":\"rwfscjfnynszquj\",\"displayName\":\"dvoqyt\",\"displayProvisioningState\":\"yo\",\"userFriendlyRenewState\":\"blgyavutpthj\",\"userFriendlyAppliedScopeType\":\"oismsksbpimlqol\",\"effectiveDateTime\":\"kcgxxlxsffgcvi\",\"skuDescription\":\"zdwlvwlyoupfgfb\",\"term\":\"ubdyhgk\",\"renew\":false,\"renewSource\":\"sgow\"}},{\"id\":\"tsttktlahbq\",\"name\":\"tx\",\"type\":\"zukxitmmqtgqq\",\"location\":\"hrnxrxc\",\"sku\":{\"name\":\"isavok\"},\"properties\":{\"appliedScopes\":[],\"appliedScopeType\":\"vazivjlfr\",\"reservedResourceType\":\"tbajlkatn\",\"quantity\":27.220089,\"provisioningState\":\"opidkqqfkuv\",\"expiryDate\":\"xkdmligo\",\"provisioningSubState\":\"brxk\",\"displayName\":\"loazuruocbgoo\",\"displayProvisioningState\":\"te\",\"userFriendlyRenewState\":\"bfhjxakvvjgsl\",\"userFriendlyAppliedScopeType\":\"dilmyww\",\"effectiveDateTime\":\"gkxnyedabg\",\"skuDescription\":\"udtjuewbc\",\"term\":\"xuuwhcj\",\"renew\":false,\"renewSource\":\"ybvpay\"}},{\"id\":\"udzpxgwjplmagstc\",\"name\":\"hpfkyrkdbdgi\",\"type\":\"sjkmnwqj\",\"location\":\"baiyhddviaceg\",\"sku\":{\"name\":\"ntfpmvmemfnc\"},\"properties\":{\"appliedScopes\":[],\"appliedScopeType\":\"vbalxlllc\",\"reservedResourceType\":\"odbzevwrdnhf\",\"quantity\":22.404224,\"provisioningState\":\"sjcswsmystuluqyp\",\"expiryDate\":\"vlerchpqbmfpjba\",\"provisioningSubState\":\"idfcxsspuunnoxyh\",\"displayName\":\"g\",\"displayProvisioningState\":\"drihpfhoqcaaewda\",\"userFriendlyRenewState\":\"djvlpj\",\"userFriendlyAppliedScopeType\":\"kzbrmsgeivsiy\",\"effectiveDateTime\":\"kdncj\",\"skuDescription\":\"onbzoggculapzwy\",\"term\":\"gogtqxepnylbf\",\"renew\":true,\"renewSource\":\"yjt\"}}],\"nextLink\":\"fqzhv\",\"summary\":{\"succeededCount\":53.406746,\"failedCount\":13.140678,\"expiringCount\":70.9251,\"expiredCount\":36.47178,\"pendingCount\":75.72936,\"cancelledCount\":24.269749}}") - .toObject(ReservationsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationsListResult model = new ReservationsListResult().withSummary(new ReservationSummary()); - model = BinaryData.fromObject(model).toObject(ReservationsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.java deleted file mode 100644 index 7afc61e4e0fd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.TransactionInner; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import org.junit.jupiter.api.Assertions; - -public final class TransactionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransactionInner model = - BinaryData - .fromString( - "{\"properties\":{\"kind\":\"reservation\",\"date\":\"2021-02-11T03:05:15Z\",\"invoice\":\"vfgbvfvpdboda\",\"invoiceId\":\"zsjqlh\",\"orderId\":\"r\",\"orderName\":\"deibqip\",\"productFamily\":\"ghvxndzwmkrefa\",\"productTypeId\":\"jorwkqnyhgbij\",\"productType\":\"ivfxzsjabibsyst\",\"productDescription\":\"fsdjpvkvp\",\"transactionType\":\"Usage" - + " Charge\",\"transactionAmount\":{\"currency\":\"zbzkdvncjabudurg\",\"value\":26.81675},\"quantity\":133724472,\"invoiceSectionId\":\"zhjjklffhmouwq\",\"invoiceSectionDisplayName\":\"zrfze\",\"billingProfileId\":\"ebizikayuh\",\"billingProfileDisplayName\":\"bjbsybb\",\"customerId\":\"r\",\"customerDisplayName\":\"ldgmfpgvmpip\",\"subscriptionId\":\"ltha\",\"subscriptionName\":\"x\",\"azurePlan\":\"mwutwbdsre\",\"azureCreditApplied\":{\"currency\":\"rhneuyowq\",\"value\":14.874917},\"billingCurrency\":\"t\",\"discount\":8.667755,\"effectivePrice\":{\"currency\":\"rcgp\",\"value\":82.618744},\"exchangeRate\":48.570366,\"marketPrice\":{\"currency\":\"j\",\"value\":71.50711},\"pricingCurrency\":\"fzxiavrmb\",\"servicePeriodStartDate\":\"2021-09-13T10:29:44Z\",\"servicePeriodEndDate\":\"2021-09-04T02:46:50Z\",\"subTotal\":{\"currency\":\"rjqc\",\"value\":39.849525},\"tax\":{\"currency\":\"frl\",\"value\":33.48236},\"unitOfMeasure\":\"rnwoiindfp\",\"units\":71.931244,\"unitType\":\"lwbtlhf\"},\"id\":\"sj\",\"name\":\"dhszfjv\",\"type\":\"bgofeljag\"}") - .toObject(TransactionInner.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransactionInner model = - new TransactionInner() - .withKind(TransactionTypeKind.RESERVATION) - .withTransactionType(ReservationType.USAGE_CHARGE); - model = BinaryData.fromObject(model).toObject(TransactionInner.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.java deleted file mode 100644 index 08865890d0ee..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.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.BinaryData; -import com.azure.resourcemanager.billing.models.TransactionListResult; - -public final class TransactionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransactionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"kind\":\"all\",\"date\":\"2021-11-17T05:10:44Z\",\"invoice\":\"l\",\"invoiceId\":\"qhoftrmaequiah\",\"orderId\":\"cslfaoqzpiyylha\",\"orderName\":\"swhccsphk\",\"productFamily\":\"vwitqscyw\",\"productTypeId\":\"gwol\",\"productType\":\"czbwemhairsbr\",\"productDescription\":\"dwmsweypqwd\",\"transactionType\":\"Usage" - + " Charge\",\"quantity\":98596504,\"invoiceSectionId\":\"n\",\"invoiceSectionDisplayName\":\"huexmk\",\"billingProfileId\":\"lstvlzywe\",\"billingProfileDisplayName\":\"zrncsdt\",\"customerId\":\"u\",\"customerDisplayName\":\"ypbsfgytguslfead\",\"subscriptionId\":\"gq\",\"subscriptionName\":\"yhejhzisxgfp\",\"azurePlan\":\"olppvksrpqvujz\",\"billingCurrency\":\"htwdwrftswibyrcd\",\"discount\":4.1148844,\"exchangeRate\":62.17856,\"pricingCurrency\":\"racstwity\",\"servicePeriodStartDate\":\"2021-10-09T17:15:47Z\",\"servicePeriodEndDate\":\"2021-11-26T04:46:53Z\",\"unitOfMeasure\":\"dcpnmdyodnw\",\"units\":98.19005,\"unitType\":\"jc\"},\"id\":\"nhltiugcxn\",\"name\":\"vvwxqi\",\"type\":\"y\"}],\"totalCount\":1643458041,\"nextLink\":\"owx\"}") - .toObject(TransactionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransactionListResult model = new TransactionListResult(); - model = BinaryData.fromObject(model).toObject(TransactionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.java deleted file mode 100644 index c18ba9efdace..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.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.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.TransactionProperties; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import org.junit.jupiter.api.Assertions; - -public final class TransactionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransactionProperties model = - BinaryData - .fromString( - "{\"kind\":\"reservation\",\"date\":\"2021-11-19T13:43:04Z\",\"invoice\":\"dvriiiojnal\",\"invoiceId\":\"fk\",\"orderId\":\"vsexsowuelu\",\"orderName\":\"hahhxvrhmzkwpj\",\"productFamily\":\"wspughftqsxhqx\",\"productTypeId\":\"xukndxdigr\",\"productType\":\"uufzdmsyqtfihw\",\"productDescription\":\"otzi\",\"transactionType\":\"Usage" - + " Charge\",\"transactionAmount\":{\"currency\":\"pph\",\"value\":41.082405},\"quantity\":1174017685,\"invoiceSectionId\":\"dphqamv\",\"invoiceSectionDisplayName\":\"fwynwcvtbvkay\",\"billingProfileId\":\"tnvyqiatkzwp\",\"billingProfileDisplayName\":\"p\",\"customerId\":\"cjaesgvvs\",\"customerDisplayName\":\"yajguqfhwygzlv\",\"subscriptionId\":\"kfxu\",\"subscriptionName\":\"mdwzrmuhapfcqdps\",\"azurePlan\":\"qvpsvuoymg\",\"azureCreditApplied\":{\"currency\":\"lvez\",\"value\":37.44613},\"billingCurrency\":\"lmfeokerq\",\"discount\":19.447208,\"effectivePrice\":{\"currency\":\"ob\",\"value\":38.23564},\"exchangeRate\":82.422646,\"marketPrice\":{\"currency\":\"owepbqpcrfkb\",\"value\":99.00544},\"pricingCurrency\":\"njv\",\"servicePeriodStartDate\":\"2020-12-20T11:43:27Z\",\"servicePeriodEndDate\":\"2021-06-07T08:17:55Z\",\"subTotal\":{\"currency\":\"ekftnkhtj\",\"value\":1.9628167},\"tax\":{\"currency\":\"wfqatmtd\",\"value\":20.163143},\"unitOfMeasure\":\"vypgikdg\",\"units\":99.876915,\"unitType\":\"kbir\"}") - .toObject(TransactionProperties.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransactionProperties model = - new TransactionProperties() - .withKind(TransactionTypeKind.RESERVATION) - .withTransactionType(ReservationType.USAGE_CHARGE); - model = BinaryData.fromObject(model).toObject(TransactionProperties.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.java deleted file mode 100644 index f0d7396d584b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.Transaction; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TransactionsListByInvoiceMockTests { - @Test - public void testListByInvoice() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"kind\":\"reservation\",\"date\":\"2021-10-25T06:31:18Z\",\"invoice\":\"vne\",\"invoiceId\":\"aifghtmoqqt\",\"orderId\":\"fhzbkr\",\"orderName\":\"jjavfq\",\"productFamily\":\"hnqoewdo\",\"productTypeId\":\"yetesy\",\"productType\":\"idbz\",\"productDescription\":\"hqtfbovn\",\"transactionType\":\"Purchase\",\"transactionAmount\":{\"currency\":\"etnjuhpsprkz\",\"value\":20.758957},\"quantity\":333927859,\"invoiceSectionId\":\"ccxnafbwqroohtuo\",\"invoiceSectionDisplayName\":\"aonurjtumg\",\"billingProfileId\":\"hpv\",\"billingProfileDisplayName\":\"mslclblyjxlt\",\"customerId\":\"juscvsfx\",\"customerDisplayName\":\"ctmgxuupbezqccy\",\"subscriptionId\":\"tce\",\"subscriptionName\":\"d\",\"azurePlan\":\"ky\",\"azureCreditApplied\":{\"currency\":\"tg\",\"value\":65.07157},\"billingCurrency\":\"qzgwldoychil\",\"discount\":47.130497,\"effectivePrice\":{\"currency\":\"ehuwaoa\",\"value\":0.38245916},\"exchangeRate\":37.166195,\"marketPrice\":{\"currency\":\"lizst\",\"value\":20.003922},\"pricingCurrency\":\"vhrweftkwqejpmv\",\"servicePeriodStartDate\":\"2021-09-05T09:38:44Z\",\"servicePeriodEndDate\":\"2021-06-10T02:31:17Z\",\"subTotal\":{\"currency\":\"wamcxtczhup\",\"value\":59.264435},\"tax\":{\"currency\":\"jduyyespydjfb\",\"value\":9.652024},\"unitOfMeasure\":\"hhulrtywikdm\",\"units\":94.05045,\"unitType\":\"uflgbhgauacdixm\"},\"id\":\"ufr\",\"name\":\"ryjqgdkf\",\"type\":\"ozo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.transactions().listByInvoice("ctwwgzw", "jlmec", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(TransactionTypeKind.RESERVATION, response.iterator().next().kind()); - Assertions.assertEquals(ReservationType.PURCHASE, response.iterator().next().transactionType()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java deleted file mode 100644 index d25251d3efc7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (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.BinaryData; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; -import org.junit.jupiter.api.Assertions; - -public final class TransferBillingSubscriptionRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransferBillingSubscriptionRequestProperties model = - BinaryData - .fromString("{\"destinationInvoiceSectionId\":\"u\"}") - .toObject(TransferBillingSubscriptionRequestProperties.class); - Assertions.assertEquals("u", model.destinationInvoiceSectionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransferBillingSubscriptionRequestProperties model = - new TransferBillingSubscriptionRequestProperties().withDestinationInvoiceSectionId("u"); - model = BinaryData.fromObject(model).toObject(TransferBillingSubscriptionRequestProperties.class); - Assertions.assertEquals("u", model.destinationInvoiceSectionId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java deleted file mode 100644 index b1fac5e65b2c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (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.BinaryData; -import com.azure.resourcemanager.billing.models.TransferProductRequestProperties; -import org.junit.jupiter.api.Assertions; - -public final class TransferProductRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransferProductRequestProperties model = - BinaryData - .fromString("{\"destinationInvoiceSectionId\":\"rfdwoyu\"}") - .toObject(TransferProductRequestProperties.class); - Assertions.assertEquals("rfdwoyu", model.destinationInvoiceSectionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransferProductRequestProperties model = - new TransferProductRequestProperties().withDestinationInvoiceSectionId("rfdwoyu"); - model = BinaryData.fromObject(model).toObject(TransferProductRequestProperties.class); - Assertions.assertEquals("rfdwoyu", model.destinationInvoiceSectionId()); - } -}