From 5fb8fd1a50d88c378929b784e00ac859a395c4c0 Mon Sep 17 00:00:00 2001 From: Tanyi Chen Date: Tue, 17 Nov 2020 10:29:53 +0800 Subject: [PATCH 1/3] add attestation/resource-manager --- eng/mgmt/api-specs.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/mgmt/api-specs.json b/eng/mgmt/api-specs.json index ada11d49520e..809bb268355d 100644 --- a/eng/mgmt/api-specs.json +++ b/eng/mgmt/api-specs.json @@ -30,6 +30,10 @@ "\"moduleName\"": "\"AppService\"" } }, + "attestation/resource-manager": { + "source": "specification/attestation/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, "automation/resource-manager": { "source": "specification/automation/resource-manager/readme.md", "args": "--multiapi --fluent" From 497cb6f7d0b0b0d53266d25926e4c8bc10761e07 Mon Sep 17 00:00:00 2001 From: Tanyi Chen Date: Tue, 17 Nov 2020 10:31:49 +0800 Subject: [PATCH 2/3] generate attestation/resource-manager 2020 10 --- sdk/attestation/mgmt-v2020_10_01/pom.xml | 135 +++ .../v2020_10_01/AttestationProvider.java | 100 ++ .../AttestationProviderListResult.java | 32 + .../v2020_10_01/AttestationProviders.java | 49 + .../AttestationServiceCreationParams.java | 97 ++ ...estationServiceCreationSpecificParams.java | 46 + .../AttestationServicePatchParams.java | 44 + .../v2020_10_01/AttestationServiceStatus.java | 44 + .../v2020_10_01/AzureEntityResource.java | 35 + .../v2020_10_01/CreatedByType.java | 47 + .../attestation/v2020_10_01/JSONWebKey.java | 535 +++++++++++ .../v2020_10_01/JSONWebKeySet.java | 56 ++ .../v2020_10_01/OperationList.java | 31 + .../attestation/v2020_10_01/Operations.java | 27 + .../v2020_10_01/OperationsDefinition.java | 69 ++ .../OperationsDisplayDefinition.java | 121 +++ .../attestation/v2020_10_01/SystemData.java | 176 ++++ .../AttestationManagementClientImpl.java | 210 +++++ .../implementation/AttestationManager.java | 111 +++ .../AttestationProviderImpl.java | 98 ++ .../AttestationProviderInner.java | 116 +++ .../AttestationProviderListResultImpl.java | 38 + .../AttestationProviderListResultInner.java | 60 ++ .../AttestationProvidersImpl.java | 151 ++++ .../AttestationProvidersInner.java | 855 ++++++++++++++++++ .../implementation/IdParsingUtils.java | 57 ++ .../implementation/OperationListImpl.java | 39 + .../implementation/OperationListInner.java | 61 ++ .../implementation/OperationsImpl.java | 42 + .../implementation/OperationsInner.java | 128 +++ .../v2020_10_01/implementation/PageImpl.java | 75 ++ .../implementation/package-info.java | 11 + .../attestation/v2020_10_01/package-info.java | 11 + 33 files changed, 3707 insertions(+) create mode 100644 sdk/attestation/mgmt-v2020_10_01/pom.xml create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProvider.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProviderListResult.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProviders.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceCreationParams.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceCreationSpecificParams.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServicePatchParams.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceStatus.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AzureEntityResource.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/CreatedByType.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/JSONWebKey.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/JSONWebKeySet.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationList.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/Operations.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationsDefinition.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationsDisplayDefinition.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/SystemData.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationManagementClientImpl.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationManager.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderImpl.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderInner.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderListResultImpl.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderListResultInner.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProvidersImpl.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProvidersInner.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/IdParsingUtils.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationListImpl.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationListInner.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationsImpl.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationsInner.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/PageImpl.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/package-info.java create mode 100644 sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/package-info.java diff --git a/sdk/attestation/mgmt-v2020_10_01/pom.xml b/sdk/attestation/mgmt-v2020_10_01/pom.xml new file mode 100644 index 000000000000..698cdb400e7a --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.attestation.v2020_10_01 + + com.microsoft.azure + azure-arm-parent + 1.3.2 + ../../parents/azure-arm-parent/pom.xml + + azure-mgmt-attestation + 1.0.0-beta + jar + Microsoft Azure SDK for Attestation Management + This package contains Microsoft Attestation Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProvider.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProvider.java new file mode 100644 index 000000000000..5259512a74ee --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProvider.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.attestation.v2020_10_01.implementation.AttestationManager; +import com.microsoft.azure.management.attestation.v2020_10_01.implementation.AttestationProviderInner; + +/** + * Type representing AttestationProvider. + */ +public interface AttestationProvider extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the attestUri value. + */ + String attestUri(); + + /** + * @return the status value. + */ + AttestationServiceStatus status(); + + /** + * @return the systemData value. + */ + SystemData systemData(); + + /** + * @return the trustModel value. + */ + String trustModel(); + + /** + * The entirety of the AttestationProvider definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of AttestationProvider definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AttestationProvider definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the AttestationProvider definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the attestationprovider definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Properties of the attestation service instance + * @return the next definition stage +*/ + WithCreate withProperties(AttestationServiceCreationSpecificParams properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags { + } + } + /** + * The template for a AttestationProvider update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of AttestationProvider update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProviderListResult.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProviderListResult.java new file mode 100644 index 000000000000..b838a3cf3971 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProviderListResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.attestation.v2020_10_01.implementation.AttestationManager; +import com.microsoft.azure.management.attestation.v2020_10_01.implementation.AttestationProviderListResultInner; +import com.microsoft.azure.management.attestation.v2020_10_01.implementation.AttestationProviderInner; +import java.util.List; + +/** + * Type representing AttestationProviderListResult. + */ +public interface AttestationProviderListResult extends HasInner, HasManager { + /** + * @return the systemData value. + */ + SystemData systemData(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProviders.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProviders.java new file mode 100644 index 000000000000..93df544d95eb --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationProviders.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.attestation.v2020_10_01.implementation.AttestationProvidersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AttestationProviders. + */ +public interface AttestationProviders extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { + /** + * Returns a list of attestation providers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Get the default provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listDefaultAsync(); + + /** + * Get the default provider by location. + * + * @param location The location of the default provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDefaultByLocationAsync(String location); + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceCreationParams.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceCreationParams.java new file mode 100644 index 000000000000..d1238756be39 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceCreationParams.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for creating an attestation service instance. + */ +public class AttestationServiceCreationParams { + /** + * The supported Azure location where the attestation service instance + * should be created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The tags that will be assigned to the attestation service instance. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Properties of the attestation service instance. + */ + @JsonProperty(value = "properties", required = true) + private AttestationServiceCreationSpecificParams properties; + + /** + * Get the supported Azure location where the attestation service instance should be created. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the supported Azure location where the attestation service instance should be created. + * + * @param location the location value to set + * @return the AttestationServiceCreationParams object itself. + */ + public AttestationServiceCreationParams withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags that will be assigned to the attestation service instance. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags that will be assigned to the attestation service instance. + * + * @param tags the tags value to set + * @return the AttestationServiceCreationParams object itself. + */ + public AttestationServiceCreationParams withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get properties of the attestation service instance. + * + * @return the properties value + */ + public AttestationServiceCreationSpecificParams properties() { + return this.properties; + } + + /** + * Set properties of the attestation service instance. + * + * @param properties the properties value to set + * @return the AttestationServiceCreationParams object itself. + */ + public AttestationServiceCreationParams withProperties(AttestationServiceCreationSpecificParams properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceCreationSpecificParams.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceCreationSpecificParams.java new file mode 100644 index 000000000000..cec06cecde1f --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceCreationSpecificParams.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Client supplied parameters used to create a new attestation service + * instance. + */ +public class AttestationServiceCreationSpecificParams { + /** + * JSON Web Key Set defining a set of X.509 Certificates that will + * represent the parent certificate for the signing certificate used for + * policy operations. + */ + @JsonProperty(value = "policySigningCertificates") + private JSONWebKeySet policySigningCertificates; + + /** + * Get jSON Web Key Set defining a set of X.509 Certificates that will represent the parent certificate for the signing certificate used for policy operations. + * + * @return the policySigningCertificates value + */ + public JSONWebKeySet policySigningCertificates() { + return this.policySigningCertificates; + } + + /** + * Set jSON Web Key Set defining a set of X.509 Certificates that will represent the parent certificate for the signing certificate used for policy operations. + * + * @param policySigningCertificates the policySigningCertificates value to set + * @return the AttestationServiceCreationSpecificParams object itself. + */ + public AttestationServiceCreationSpecificParams withPolicySigningCertificates(JSONWebKeySet policySigningCertificates) { + this.policySigningCertificates = policySigningCertificates; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServicePatchParams.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServicePatchParams.java new file mode 100644 index 000000000000..399a9c33f3df --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServicePatchParams.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for patching an attestation service instance. + */ +public class AttestationServicePatchParams { + /** + * The tags that will be assigned to the attestation service instance. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags that will be assigned to the attestation service instance. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags that will be assigned to the attestation service instance. + * + * @param tags the tags value to set + * @return the AttestationServicePatchParams object itself. + */ + public AttestationServicePatchParams withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceStatus.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceStatus.java new file mode 100644 index 000000000000..c3f3bb161bc2 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AttestationServiceStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AttestationServiceStatus. + */ +public final class AttestationServiceStatus extends ExpandableStringEnum { + /** Static value Ready for AttestationServiceStatus. */ + public static final AttestationServiceStatus READY = fromString("Ready"); + + /** Static value NotReady for AttestationServiceStatus. */ + public static final AttestationServiceStatus NOT_READY = fromString("NotReady"); + + /** Static value Error for AttestationServiceStatus. */ + public static final AttestationServiceStatus ERROR = fromString("Error"); + + /** + * Creates or finds a AttestationServiceStatus from its string representation. + * @param name a name to look for + * @return the corresponding AttestationServiceStatus + */ + @JsonCreator + public static AttestationServiceStatus fromString(String name) { + return fromString(name, AttestationServiceStatus.class); + } + + /** + * @return known AttestationServiceStatus values + */ + public static Collection values() { + return values(AttestationServiceStatus.class); + } +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AzureEntityResource.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AzureEntityResource.java new file mode 100644 index 000000000000..010ec8f488fa --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/AzureEntityResource.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Entity Resource. + * The resource model definition for an Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/CreatedByType.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/CreatedByType.java new file mode 100644 index 000000000000..7042810d717d --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/CreatedByType.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CreatedByType. + */ +public final class CreatedByType extends ExpandableStringEnum { + /** Static value User for CreatedByType. */ + public static final CreatedByType USER = fromString("User"); + + /** Static value Application for CreatedByType. */ + public static final CreatedByType APPLICATION = fromString("Application"); + + /** Static value ManagedIdentity for CreatedByType. */ + public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** Static value Key for CreatedByType. */ + public static final CreatedByType KEY = fromString("Key"); + + /** + * Creates or finds a CreatedByType from its string representation. + * @param name a name to look for + * @return the corresponding CreatedByType + */ + @JsonCreator + public static CreatedByType fromString(String name) { + return fromString(name, CreatedByType.class); + } + + /** + * @return known CreatedByType values + */ + public static Collection values() { + return values(CreatedByType.class); + } +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/JSONWebKey.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/JSONWebKey.java new file mode 100644 index 000000000000..c675893af8dc --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/JSONWebKey.java @@ -0,0 +1,535 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JSONWebKey model. + */ +public class JSONWebKey { + /** + * The "alg" (algorithm) parameter identifies the algorithm intended for + * use with the key. The values used should either be registered in the + * IANA "JSON Web Signature and Encryption Algorithms" registry + * established by [JWA] or be a value that contains a Collision- + * Resistant Name. + */ + @JsonProperty(value = "alg", required = true) + private String alg; + + /** + * The "crv" (curve) parameter identifies the curve type. + */ + @JsonProperty(value = "crv") + private String crv; + + /** + * RSA private exponent or ECC private key. + */ + @JsonProperty(value = "d") + private String d; + + /** + * RSA Private Key Parameter. + */ + @JsonProperty(value = "dp") + private String dp; + + /** + * RSA Private Key Parameter. + */ + @JsonProperty(value = "dq") + private String dq; + + /** + * RSA public exponent, in Base64. + */ + @JsonProperty(value = "e") + private String e; + + /** + * Symmetric key. + */ + @JsonProperty(value = "k") + private String k; + + /** + * The "kid" (key ID) parameter is used to match a specific key. This + * is used, for instance, to choose among a set of keys within a JWK Set + * during key rollover. The structure of the "kid" value is + * unspecified. When "kid" values are used within a JWK Set, different + * keys within the JWK Set SHOULD use distinct "kid" values. (One + * example in which different keys might use the same "kid" value is if + * they have different "kty" (key type) values but are considered to be + * equivalent alternatives by the application using them.) The "kid" + * value is a case-sensitive string. + */ + @JsonProperty(value = "kid", required = true) + private String kid; + + /** + * The "kty" (key type) parameter identifies the cryptographic algorithm + * family used with the key, such as "RSA" or "EC". "kty" values should + * either be registered in the IANA "JSON Web Key Types" registry + * established by [JWA] or be a value that contains a Collision- + * Resistant Name. The "kty" value is a case-sensitive string. + */ + @JsonProperty(value = "kty", required = true) + private String kty; + + /** + * RSA modulus, in Base64. + */ + @JsonProperty(value = "n") + private String n; + + /** + * RSA secret prime. + */ + @JsonProperty(value = "p") + private String p; + + /** + * RSA secret prime, with p < q. + */ + @JsonProperty(value = "q") + private String q; + + /** + * RSA Private Key Parameter. + */ + @JsonProperty(value = "qi") + private String qi; + + /** + * Use ("public key use") identifies the intended use of + * the public key. The "use" parameter is employed to indicate whether + * a public key is used for encrypting data or verifying the signature + * on data. Values are commonly "sig" (signature) or "enc" (encryption). + */ + @JsonProperty(value = "use", required = true) + private String use; + + /** + * X coordinate for the Elliptic Curve point. + */ + @JsonProperty(value = "x") + private String x; + + /** + * The "x5c" (X.509 certificate chain) parameter contains a chain of one + * or more PKIX certificates [RFC5280]. The certificate chain is + * represented as a JSON array of certificate value strings. Each + * string in the array is a base64-encoded (Section 4 of [RFC4648] -- + * not base64url-encoded) DER [ITU.X690.1994] PKIX certificate value. + * The PKIX certificate containing the key value MUST be the first + * certificate. + */ + @JsonProperty(value = "x5c") + private List x5c; + + /** + * Y coordinate for the Elliptic Curve point. + */ + @JsonProperty(value = "y") + private String y; + + /** + * Get the "alg" (algorithm) parameter identifies the algorithm intended for + use with the key. The values used should either be registered in the + IANA "JSON Web Signature and Encryption Algorithms" registry + established by [JWA] or be a value that contains a Collision- + Resistant Name. + * + * @return the alg value + */ + public String alg() { + return this.alg; + } + + /** + * Set the "alg" (algorithm) parameter identifies the algorithm intended for + use with the key. The values used should either be registered in the + IANA "JSON Web Signature and Encryption Algorithms" registry + established by [JWA] or be a value that contains a Collision- + Resistant Name. + * + * @param alg the alg value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withAlg(String alg) { + this.alg = alg; + return this; + } + + /** + * Get the "crv" (curve) parameter identifies the curve type. + * + * @return the crv value + */ + public String crv() { + return this.crv; + } + + /** + * Set the "crv" (curve) parameter identifies the curve type. + * + * @param crv the crv value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withCrv(String crv) { + this.crv = crv; + return this; + } + + /** + * Get rSA private exponent or ECC private key. + * + * @return the d value + */ + public String d() { + return this.d; + } + + /** + * Set rSA private exponent or ECC private key. + * + * @param d the d value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withD(String d) { + this.d = d; + return this; + } + + /** + * Get rSA Private Key Parameter. + * + * @return the dp value + */ + public String dp() { + return this.dp; + } + + /** + * Set rSA Private Key Parameter. + * + * @param dp the dp value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withDp(String dp) { + this.dp = dp; + return this; + } + + /** + * Get rSA Private Key Parameter. + * + * @return the dq value + */ + public String dq() { + return this.dq; + } + + /** + * Set rSA Private Key Parameter. + * + * @param dq the dq value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withDq(String dq) { + this.dq = dq; + return this; + } + + /** + * Get rSA public exponent, in Base64. + * + * @return the e value + */ + public String e() { + return this.e; + } + + /** + * Set rSA public exponent, in Base64. + * + * @param e the e value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withE(String e) { + this.e = e; + return this; + } + + /** + * Get symmetric key. + * + * @return the k value + */ + public String k() { + return this.k; + } + + /** + * Set symmetric key. + * + * @param k the k value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withK(String k) { + this.k = k; + return this; + } + + /** + * Get the "kid" (key ID) parameter is used to match a specific key. This + is used, for instance, to choose among a set of keys within a JWK Set + during key rollover. The structure of the "kid" value is + unspecified. When "kid" values are used within a JWK Set, different + keys within the JWK Set SHOULD use distinct "kid" values. (One + example in which different keys might use the same "kid" value is if + they have different "kty" (key type) values but are considered to be + equivalent alternatives by the application using them.) The "kid" + value is a case-sensitive string. + * + * @return the kid value + */ + public String kid() { + return this.kid; + } + + /** + * Set the "kid" (key ID) parameter is used to match a specific key. This + is used, for instance, to choose among a set of keys within a JWK Set + during key rollover. The structure of the "kid" value is + unspecified. When "kid" values are used within a JWK Set, different + keys within the JWK Set SHOULD use distinct "kid" values. (One + example in which different keys might use the same "kid" value is if + they have different "kty" (key type) values but are considered to be + equivalent alternatives by the application using them.) The "kid" + value is a case-sensitive string. + * + * @param kid the kid value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withKid(String kid) { + this.kid = kid; + return this; + } + + /** + * Get the "kty" (key type) parameter identifies the cryptographic algorithm + family used with the key, such as "RSA" or "EC". "kty" values should + either be registered in the IANA "JSON Web Key Types" registry + established by [JWA] or be a value that contains a Collision- + Resistant Name. The "kty" value is a case-sensitive string. + * + * @return the kty value + */ + public String kty() { + return this.kty; + } + + /** + * Set the "kty" (key type) parameter identifies the cryptographic algorithm + family used with the key, such as "RSA" or "EC". "kty" values should + either be registered in the IANA "JSON Web Key Types" registry + established by [JWA] or be a value that contains a Collision- + Resistant Name. The "kty" value is a case-sensitive string. + * + * @param kty the kty value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withKty(String kty) { + this.kty = kty; + return this; + } + + /** + * Get rSA modulus, in Base64. + * + * @return the n value + */ + public String n() { + return this.n; + } + + /** + * Set rSA modulus, in Base64. + * + * @param n the n value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withN(String n) { + this.n = n; + return this; + } + + /** + * Get rSA secret prime. + * + * @return the p value + */ + public String p() { + return this.p; + } + + /** + * Set rSA secret prime. + * + * @param p the p value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withP(String p) { + this.p = p; + return this; + } + + /** + * Get rSA secret prime, with p < q. + * + * @return the q value + */ + public String q() { + return this.q; + } + + /** + * Set rSA secret prime, with p < q. + * + * @param q the q value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withQ(String q) { + this.q = q; + return this; + } + + /** + * Get rSA Private Key Parameter. + * + * @return the qi value + */ + public String qi() { + return this.qi; + } + + /** + * Set rSA Private Key Parameter. + * + * @param qi the qi value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withQi(String qi) { + this.qi = qi; + return this; + } + + /** + * Get use ("public key use") identifies the intended use of + the public key. The "use" parameter is employed to indicate whether + a public key is used for encrypting data or verifying the signature + on data. Values are commonly "sig" (signature) or "enc" (encryption). + * + * @return the use value + */ + public String use() { + return this.use; + } + + /** + * Set use ("public key use") identifies the intended use of + the public key. The "use" parameter is employed to indicate whether + a public key is used for encrypting data or verifying the signature + on data. Values are commonly "sig" (signature) or "enc" (encryption). + * + * @param use the use value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withUse(String use) { + this.use = use; + return this; + } + + /** + * Get x coordinate for the Elliptic Curve point. + * + * @return the x value + */ + public String x() { + return this.x; + } + + /** + * Set x coordinate for the Elliptic Curve point. + * + * @param x the x value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withX(String x) { + this.x = x; + return this; + } + + /** + * Get the "x5c" (X.509 certificate chain) parameter contains a chain of one + or more PKIX certificates [RFC5280]. The certificate chain is + represented as a JSON array of certificate value strings. Each + string in the array is a base64-encoded (Section 4 of [RFC4648] -- + not base64url-encoded) DER [ITU.X690.1994] PKIX certificate value. + The PKIX certificate containing the key value MUST be the first + certificate. + * + * @return the x5c value + */ + public List x5c() { + return this.x5c; + } + + /** + * Set the "x5c" (X.509 certificate chain) parameter contains a chain of one + or more PKIX certificates [RFC5280]. The certificate chain is + represented as a JSON array of certificate value strings. Each + string in the array is a base64-encoded (Section 4 of [RFC4648] -- + not base64url-encoded) DER [ITU.X690.1994] PKIX certificate value. + The PKIX certificate containing the key value MUST be the first + certificate. + * + * @param x5c the x5c value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withX5c(List x5c) { + this.x5c = x5c; + return this; + } + + /** + * Get y coordinate for the Elliptic Curve point. + * + * @return the y value + */ + public String y() { + return this.y; + } + + /** + * Set y coordinate for the Elliptic Curve point. + * + * @param y the y value to set + * @return the JSONWebKey object itself. + */ + public JSONWebKey withY(String y) { + this.y = y; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/JSONWebKeySet.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/JSONWebKeySet.java new file mode 100644 index 000000000000..03e4e2369a64 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/JSONWebKeySet.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JSONWebKeySet model. + */ +public class JSONWebKeySet { + /** + * The value of the "keys" parameter is an array of JWK values. By + * default, the order of the JWK values within the array does not imply + * an order of preference among them, although applications of JWK Sets + * can choose to assign a meaning to the order for their purposes, if + * desired. + */ + @JsonProperty(value = "keys") + private List keys; + + /** + * Get the value of the "keys" parameter is an array of JWK values. By + default, the order of the JWK values within the array does not imply + an order of preference among them, although applications of JWK Sets + can choose to assign a meaning to the order for their purposes, if + desired. + * + * @return the keys value + */ + public List keys() { + return this.keys; + } + + /** + * Set the value of the "keys" parameter is an array of JWK values. By + default, the order of the JWK values within the array does not imply + an order of preference among them, although applications of JWK Sets + can choose to assign a meaning to the order for their purposes, if + desired. + * + * @param keys the keys value to set + * @return the JSONWebKeySet object itself. + */ + public JSONWebKeySet withKeys(List keys) { + this.keys = keys; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationList.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationList.java new file mode 100644 index 000000000000..9f1233960bff --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationList.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.attestation.v2020_10_01.implementation.AttestationManager; +import com.microsoft.azure.management.attestation.v2020_10_01.implementation.OperationListInner; +import java.util.List; + +/** + * Type representing OperationList. + */ +public interface OperationList extends HasInner, HasManager { + /** + * @return the systemData value. + */ + SystemData systemData(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/Operations.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/Operations.java new file mode 100644 index 000000000000..7642321731b3 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import rx.Observable; +import com.microsoft.azure.management.attestation.v2020_10_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Azure attestation operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationsDefinition.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationsDefinition.java new file mode 100644 index 000000000000..c8df9b795849 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationsDefinition.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Definition object with the name and properties of an operation. + */ +public class OperationsDefinition { + /** + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display object with properties of the operation. + */ + @JsonProperty(value = "display") + private OperationsDisplayDefinition display; + + /** + * Get name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the operation. + * + * @param name the name value to set + * @return the OperationsDefinition object itself. + */ + public OperationsDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get display object with properties of the operation. + * + * @return the display value + */ + public OperationsDisplayDefinition display() { + return this.display; + } + + /** + * Set display object with properties of the operation. + * + * @param display the display value to set + * @return the OperationsDefinition object itself. + */ + public OperationsDefinition withDisplay(OperationsDisplayDefinition display) { + this.display = display; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationsDisplayDefinition.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationsDisplayDefinition.java new file mode 100644 index 000000000000..56e90c4c740d --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/OperationsDisplayDefinition.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display object with properties of the operation. + */ +public class OperationsDisplayDefinition { + /** + * Resource provider of the operation. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource for the operation. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Short description of the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get resource provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set resource provider of the operation. + * + * @param provider the provider value to set + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource for the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource for the operation. + * + * @param resource the resource value to set + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get short description of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set short description of the operation. + * + * @param operation the operation value to set + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/SystemData.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/SystemData.java new file mode 100644 index 000000000000..e4dea862299f --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/SystemData.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata pertaining to creation and last modification of the resource. + */ +public class SystemData { + /** + * The identity that created the resource. + */ + @JsonProperty(value = "createdBy") + private String createdBy; + + /** + * The type of identity that created the resource. Possible values include: + * 'User', 'Application', 'ManagedIdentity', 'Key'. + */ + @JsonProperty(value = "createdByType") + private CreatedByType createdByType; + + /** + * The timestamp of resource creation (UTC). + */ + @JsonProperty(value = "createdAt") + private DateTime createdAt; + + /** + * The identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedBy") + private String lastModifiedBy; + + /** + * The type of identity that last modified the resource. Possible values + * include: 'User', 'Application', 'ManagedIdentity', 'Key'. + */ + @JsonProperty(value = "lastModifiedByType") + private CreatedByType lastModifiedByType; + + /** + * The type of identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedAt") + private DateTime lastModifiedAt; + + /** + * Get the identity that created the resource. + * + * @return the createdBy value + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Set the identity that created the resource. + * + * @param createdBy the createdBy value to set + * @return the SystemData object itself. + */ + public SystemData withCreatedBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'. + * + * @return the createdByType value + */ + public CreatedByType createdByType() { + return this.createdByType; + } + + /** + * Set the type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'. + * + * @param createdByType the createdByType value to set + * @return the SystemData object itself. + */ + public SystemData withCreatedByType(CreatedByType createdByType) { + this.createdByType = createdByType; + return this; + } + + /** + * Get the timestamp of resource creation (UTC). + * + * @return the createdAt value + */ + public DateTime createdAt() { + return this.createdAt; + } + + /** + * Set the timestamp of resource creation (UTC). + * + * @param createdAt the createdAt value to set + * @return the SystemData object itself. + */ + public SystemData withCreatedAt(DateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the identity that last modified the resource. + * + * @return the lastModifiedBy value + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set the identity that last modified the resource. + * + * @param lastModifiedBy the lastModifiedBy value to set + * @return the SystemData object itself. + */ + public SystemData withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'. + * + * @return the lastModifiedByType value + */ + public CreatedByType lastModifiedByType() { + return this.lastModifiedByType; + } + + /** + * Set the type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'. + * + * @param lastModifiedByType the lastModifiedByType value to set + * @return the SystemData object itself. + */ + public SystemData withLastModifiedByType(CreatedByType lastModifiedByType) { + this.lastModifiedByType = lastModifiedByType; + return this; + } + + /** + * Get the type of identity that last modified the resource. + * + * @return the lastModifiedAt value + */ + public DateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * Set the type of identity that last modified the resource. + * + * @param lastModifiedAt the lastModifiedAt value to set + * @return the SystemData object itself. + */ + public SystemData withLastModifiedAt(DateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationManagementClientImpl.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationManagementClientImpl.java new file mode 100644 index 000000000000..57efbea6c559 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AttestationManagementClientImpl class. + */ +public class AttestationManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Client API version. Current version is 2020-10-01. */ + private String apiVersion; + + /** + * Gets Client API version. Current version is 2020-10-01. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AttestationManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AttestationManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AttestationManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AttestationManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The AttestationProvidersInner object to access its operations. + */ + private AttestationProvidersInner attestationProviders; + + /** + * Gets the AttestationProvidersInner object to access its operations. + * @return the AttestationProvidersInner object. + */ + public AttestationProvidersInner attestationProviders() { + return this.attestationProviders; + } + + /** + * Initializes an instance of AttestationManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public AttestationManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AttestationManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AttestationManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AttestationManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AttestationManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-10-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.attestationProviders = new AttestationProvidersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AttestationManagementClient", "2020-10-01"); + } +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationManager.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationManager.java new file mode 100644 index 000000000000..e8b03eef1738 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationManager.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.attestation.v2020_10_01.Operations; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviders; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Attestation resource management. + */ +public final class AttestationManager extends ManagerCore { + private Operations operations; + private AttestationProviders attestationProviders; + /** + * Get a Configurable instance that can be used to create AttestationManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new AttestationManager.ConfigurableImpl(); + } + /** + * Creates an instance of AttestationManager that exposes Attestation resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the AttestationManager + */ + public static AttestationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new AttestationManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of AttestationManager that exposes Attestation resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the AttestationManager + */ + public static AttestationManager authenticate(RestClient restClient, String subscriptionId) { + return new AttestationManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of AttestationManager that exposes Attestation management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Attestation management API entry points that work across subscriptions + */ + AttestationManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage AttestationProviders. + */ + public AttestationProviders attestationProviders() { + if (this.attestationProviders == null) { + this.attestationProviders = new AttestationProvidersImpl(this); + } + return this.attestationProviders; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public AttestationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return AttestationManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private AttestationManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AttestationManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderImpl.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderImpl.java new file mode 100644 index 000000000000..3cbb23baf86a --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationProvider; +import rx.Observable; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationServiceCreationParams; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationServiceStatus; +import com.microsoft.azure.management.attestation.v2020_10_01.SystemData; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationServiceCreationSpecificParams; +import rx.functions.Func1; + +class AttestationProviderImpl extends GroupableResourceCoreImpl implements AttestationProvider, AttestationProvider.Definition, AttestationProvider.Update { + private AttestationServiceCreationParams createOrUpdateParameter; + AttestationProviderImpl(String name, AttestationProviderInner inner, AttestationManager manager) { + super(name, inner, manager); + this.createOrUpdateParameter = new AttestationServiceCreationParams(); + } + + @Override + public Observable createResourceAsync() { + AttestationProvidersInner client = this.manager().inner().attestationProviders(); + this.createOrUpdateParameter.withLocation(inner().location()); + this.createOrUpdateParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public AttestationProviderInner call(AttestationProviderInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AttestationProvidersInner client = this.manager().inner().attestationProviders(); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public AttestationProviderInner call(AttestationProviderInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AttestationProvidersInner client = this.manager().inner().attestationProviders(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new AttestationServiceCreationParams(); + } + + @Override + public String attestUri() { + return this.inner().attestUri(); + } + + @Override + public AttestationServiceStatus status() { + return this.inner().status(); + } + + @Override + public SystemData systemData() { + return this.inner().systemData(); + } + + @Override + public String trustModel() { + return this.inner().trustModel(); + } + + @Override + public AttestationProviderImpl withProperties(AttestationServiceCreationSpecificParams properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderInner.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderInner.java new file mode 100644 index 000000000000..15cb5895b9f1 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderInner.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.management.attestation.v2020_10_01.SystemData; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationServiceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Attestation service response message. + */ +@JsonFlatten +public class AttestationProviderInner extends Resource { + /** + * The system metadata relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Trust model for the attestation service instance. + */ + @JsonProperty(value = "properties.trustModel") + private String trustModel; + + /** + * Status of attestation service. Possible values include: 'Ready', + * 'NotReady', 'Error'. + */ + @JsonProperty(value = "properties.status") + private AttestationServiceStatus status; + + /** + * Gets the uri of attestation service. + */ + @JsonProperty(value = "properties.attestUri") + private String attestUri; + + /** + * Get the system metadata relating to this resource. + * + * @return the systemData value + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get trust model for the attestation service instance. + * + * @return the trustModel value + */ + public String trustModel() { + return this.trustModel; + } + + /** + * Set trust model for the attestation service instance. + * + * @param trustModel the trustModel value to set + * @return the AttestationProviderInner object itself. + */ + public AttestationProviderInner withTrustModel(String trustModel) { + this.trustModel = trustModel; + return this; + } + + /** + * Get status of attestation service. Possible values include: 'Ready', 'NotReady', 'Error'. + * + * @return the status value + */ + public AttestationServiceStatus status() { + return this.status; + } + + /** + * Set status of attestation service. Possible values include: 'Ready', 'NotReady', 'Error'. + * + * @param status the status value to set + * @return the AttestationProviderInner object itself. + */ + public AttestationProviderInner withStatus(AttestationServiceStatus status) { + this.status = status; + return this; + } + + /** + * Get gets the uri of attestation service. + * + * @return the attestUri value + */ + public String attestUri() { + return this.attestUri; + } + + /** + * Set gets the uri of attestation service. + * + * @param attestUri the attestUri value to set + * @return the AttestationProviderInner object itself. + */ + public AttestationProviderInner withAttestUri(String attestUri) { + this.attestUri = attestUri; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderListResultImpl.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderListResultImpl.java new file mode 100644 index 000000000000..dacf1a376d4b --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderListResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviderListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.attestation.v2020_10_01.SystemData; +import java.util.List; + +class AttestationProviderListResultImpl extends WrapperImpl implements AttestationProviderListResult { + private final AttestationManager manager; + AttestationProviderListResultImpl(AttestationProviderListResultInner inner, AttestationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AttestationManager manager() { + return this.manager; + } + + @Override + public SystemData systemData() { + return this.inner().systemData(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderListResultInner.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderListResultInner.java new file mode 100644 index 000000000000..e0b696c95d45 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProviderListResultInner.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.management.attestation.v2020_10_01.SystemData; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Attestation Providers List. + */ +public class AttestationProviderListResultInner { + /** + * The system metadata relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Attestation Provider array. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the system metadata relating to this resource. + * + * @return the systemData value + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get attestation Provider array. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set attestation Provider array. + * + * @param value the value value to set + * @return the AttestationProviderListResultInner object itself. + */ + public AttestationProviderListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProvidersImpl.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProvidersImpl.java new file mode 100644 index 000000000000..1dd8430001aa --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProvidersImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviders; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationProvider; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviderListResult; + +class AttestationProvidersImpl extends GroupableResourcesCoreImpl implements AttestationProviders { + protected AttestationProvidersImpl(AttestationManager manager) { + super(manager.inner().attestationProviders(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AttestationProvidersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AttestationProvidersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AttestationProvidersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AttestationProvidersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public AttestationProvider call(AttestationProviderInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public AttestationProviderImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listAsync() { + AttestationProvidersInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public AttestationProviderListResult call(AttestationProviderListResultInner inner) { + return new AttestationProviderListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listDefaultAsync() { + AttestationProvidersInner client = this.inner(); + return client.listDefaultAsync() + .map(new Func1() { + @Override + public AttestationProviderListResult call(AttestationProviderListResultInner inner) { + return new AttestationProviderListResultImpl(inner, manager()); + } + }); + } + + @Override + protected AttestationProviderImpl wrapModel(AttestationProviderInner inner) { + return new AttestationProviderImpl(inner.name(), inner, manager()); + } + + @Override + protected AttestationProviderImpl wrapModel(String name) { + return new AttestationProviderImpl(name, new AttestationProviderInner(), this.manager()); + } + + @Override + public Observable getDefaultByLocationAsync(String location) { + AttestationProvidersInner client = this.inner(); + return client.getDefaultByLocationAsync(location) + .map(new Func1() { + @Override + public AttestationProvider call(AttestationProviderInner inner) { + return new AttestationProviderImpl(inner.name(), inner, manager()); + } + }); + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProvidersInner.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProvidersInner.java new file mode 100644 index 000000000000..8836f28b4be1 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/AttestationProvidersInner.java @@ -0,0 +1,855 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationServiceCreationParams; +import com.microsoft.azure.management.attestation.v2020_10_01.AttestationServicePatchParams; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AttestationProviders. + */ +public class AttestationProvidersInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private AttestationProvidersService service; + /** The service client containing this operation class. */ + private AttestationManagementClientImpl client; + + /** + * Initializes an instance of AttestationProvidersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AttestationProvidersInner(Retrofit retrofit, AttestationManagementClientImpl client) { + this.service = retrofit.create(AttestationProvidersService.class); + this.client = client; + } + + /** + * The interface defining all the services for AttestationProviders to be + * used by Retrofit to perform actually REST calls. + */ + interface AttestationProvidersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviders getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviders create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Query("api-version") String apiVersion, @Body AttestationServiceCreationParams creationParams, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviders update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AttestationServicePatchParams updateParams, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviders delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviders list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Attestation/attestationProviders") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviders listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviders listDefault" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Attestation/defaultProviders") + Observable> listDefault(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.attestation.v2020_10_01.AttestationProviders getDefaultByLocation" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Attestation/locations/{location}/defaultProvider") + Observable> getDefaultByLocation(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the status of Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttestationProviderInner object if successful. + */ + public AttestationProviderInner getByResourceGroup(String resourceGroupName, String providerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, providerName).toBlocking().single().body(); + } + + /** + * Get the status of Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String providerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, providerName), serviceCallback); + } + + /** + * Get the status of Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String providerName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, providerName).map(new Func1, AttestationProviderInner>() { + @Override + public AttestationProviderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the status of Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String providerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerName == null) { + throw new IllegalArgumentException("Parameter providerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, providerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new Attestation Provider instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @param creationParams Client supplied parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttestationProviderInner object if successful. + */ + public AttestationProviderInner create(String resourceGroupName, String providerName, AttestationServiceCreationParams creationParams) { + return createWithServiceResponseAsync(resourceGroupName, providerName, creationParams).toBlocking().single().body(); + } + + /** + * Creates a new Attestation Provider instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @param creationParams Client supplied parameters. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String providerName, AttestationServiceCreationParams creationParams, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, providerName, creationParams), serviceCallback); + } + + /** + * Creates a new Attestation Provider instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @param creationParams Client supplied parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderInner object + */ + public Observable createAsync(String resourceGroupName, String providerName, AttestationServiceCreationParams creationParams) { + return createWithServiceResponseAsync(resourceGroupName, providerName, creationParams).map(new Func1, AttestationProviderInner>() { + @Override + public AttestationProviderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new Attestation Provider instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @param creationParams Client supplied parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String providerName, AttestationServiceCreationParams creationParams) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerName == null) { + throw new IllegalArgumentException("Parameter providerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (creationParams == null) { + throw new IllegalArgumentException("Parameter creationParams is required and cannot be null."); + } + Validator.validate(creationParams); + return service.create(this.client.subscriptionId(), resourceGroupName, providerName, this.client.apiVersion(), creationParams, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttestationProviderInner object if successful. + */ + public AttestationProviderInner update(String resourceGroupName, String providerName) { + return updateWithServiceResponseAsync(resourceGroupName, providerName).toBlocking().single().body(); + } + + /** + * Updates the Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String providerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, providerName), serviceCallback); + } + + /** + * Updates the Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderInner object + */ + public Observable updateAsync(String resourceGroupName, String providerName) { + return updateWithServiceResponseAsync(resourceGroupName, providerName).map(new Func1, AttestationProviderInner>() { + @Override + public AttestationProviderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String providerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerName == null) { + throw new IllegalArgumentException("Parameter providerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + AttestationServicePatchParams updateParams = new AttestationServicePatchParams(); + updateParams.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, providerName, this.client.apiVersion(), this.client.acceptLanguage(), updateParams, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @param tags The tags that will be assigned to the attestation service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttestationProviderInner object if successful. + */ + public AttestationProviderInner update(String resourceGroupName, String providerName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, providerName, tags).toBlocking().single().body(); + } + + /** + * Updates the Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @param tags The tags that will be assigned to the attestation service instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String providerName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, providerName, tags), serviceCallback); + } + + /** + * Updates the Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @param tags The tags that will be assigned to the attestation service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderInner object + */ + public Observable updateAsync(String resourceGroupName, String providerName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, providerName, tags).map(new Func1, AttestationProviderInner>() { + @Override + public AttestationProviderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Attestation Provider. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service instance. + * @param tags The tags that will be assigned to the attestation service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String providerName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerName == null) { + throw new IllegalArgumentException("Parameter providerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + AttestationServicePatchParams updateParams = new AttestationServicePatchParams(); + updateParams.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, providerName, this.client.apiVersion(), this.client.acceptLanguage(), updateParams, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete Attestation Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String providerName) { + deleteWithServiceResponseAsync(resourceGroupName, providerName).toBlocking().single().body(); + } + + /** + * Delete Attestation Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String providerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, providerName), serviceCallback); + } + + /** + * Delete Attestation Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String providerName) { + return deleteWithServiceResponseAsync(resourceGroupName, providerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Attestation Service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Name of the attestation service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String providerName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (providerName == null) { + throw new IllegalArgumentException("Parameter providerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, providerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns a list of attestation providers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttestationProviderListResultInner object if successful. + */ + public AttestationProviderListResultInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Returns a list of attestation providers in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Returns a list of attestation providers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderListResultInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, AttestationProviderListResultInner>() { + @Override + public AttestationProviderListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a list of attestation providers in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderListResultInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns attestation providers list in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Returns attestation providers list in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Returns attestation providers list in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the observable to the List<AttestationProviderInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Returns attestation providers list in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the observable to the List<AttestationProviderInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the default provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttestationProviderListResultInner object if successful. + */ + public AttestationProviderListResultInner listDefault() { + return listDefaultWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get the default provider. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listDefaultAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listDefaultWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get the default provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderListResultInner object + */ + public Observable listDefaultAsync() { + return listDefaultWithServiceResponseAsync().map(new Func1, AttestationProviderListResultInner>() { + @Override + public AttestationProviderListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the default provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderListResultInner object + */ + public Observable> listDefaultWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listDefault(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDefaultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDefaultDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the default provider by location. + * + * @param location The location of the default provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttestationProviderInner object if successful. + */ + public AttestationProviderInner getDefaultByLocation(String location) { + return getDefaultByLocationWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the default provider by location. + * + * @param location The location of the default provider. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultByLocationAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultByLocationWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the default provider by location. + * + * @param location The location of the default provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderInner object + */ + public Observable getDefaultByLocationAsync(String location) { + return getDefaultByLocationWithServiceResponseAsync(location).map(new Func1, AttestationProviderInner>() { + @Override + public AttestationProviderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the default provider by location. + * + * @param location The location of the default provider. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttestationProviderInner object + */ + public Observable> getDefaultByLocationWithServiceResponseAsync(String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getDefaultByLocation(location, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultByLocationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultByLocationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/IdParsingUtils.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..22dbde7214e4 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationListImpl.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationListImpl.java new file mode 100644 index 000000000000..210995167512 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationListImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.management.attestation.v2020_10_01.OperationList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.attestation.v2020_10_01.SystemData; +import java.util.List; +import com.microsoft.azure.management.attestation.v2020_10_01.OperationsDefinition; + +class OperationListImpl extends WrapperImpl implements OperationList { + private final AttestationManager manager; + OperationListImpl(OperationListInner inner, AttestationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AttestationManager manager() { + return this.manager; + } + + @Override + public SystemData systemData() { + return this.inner().systemData(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationListInner.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationListInner.java new file mode 100644 index 000000000000..120def4743a5 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationListInner.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.management.attestation.v2020_10_01.SystemData; +import java.util.List; +import com.microsoft.azure.management.attestation.v2020_10_01.OperationsDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of supported operations. + */ +public class OperationListInner { + /** + * The system metadata relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * List of supported operations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the system metadata relating to this resource. + * + * @return the systemData value + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get list of supported operations. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of supported operations. + * + * @param value the value value to set + * @return the OperationListInner object itself. + */ + public OperationListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationsImpl.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..f4945bbdff6e --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.attestation.v2020_10_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.attestation.v2020_10_01.OperationList; + +class OperationsImpl extends WrapperImpl implements Operations { + private final AttestationManager manager; + + OperationsImpl(AttestationManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public AttestationManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public OperationList call(OperationListInner inner) { + return new OperationListImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationsInner.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..c30ea4226442 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private AttestationManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, AttestationManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.attestation.v2020_10_01.Operations list" }) + @GET("providers/Microsoft.Attestation/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Azure attestation operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListInner object if successful. + */ + public OperationListInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available Azure attestation operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available Azure attestation operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, OperationListInner>() { + @Override + public OperationListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure attestation operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListInner object + */ + public Observable> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/PageImpl.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/PageImpl.java new file mode 100644 index 000000000000..75283a7de403 --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/package-info.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/package-info.java new file mode 100644 index 000000000000..de54ad2fd86a --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for AttestationManagementClient. + * Various APIs for managing resources in attestation service. This primarily encompasses per-tenant instance management. + */ +package com.microsoft.azure.management.attestation.v2020_10_01.implementation; diff --git a/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/package-info.java b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/package-info.java new file mode 100644 index 000000000000..99013f50018b --- /dev/null +++ b/sdk/attestation/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/attestation/v2020_10_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for AttestationManagementClient. + * Various APIs for managing resources in attestation service. This primarily encompasses per-tenant instance management. + */ +package com.microsoft.azure.management.attestation.v2020_10_01; From 8e8ef4480d53c66911f0379880257f0d3c4637b0 Mon Sep 17 00:00:00 2001 From: Tanyi Chen Date: Tue, 17 Nov 2020 10:33:54 +0800 Subject: [PATCH 3/3] add ci and pom --- sdk/attestation/ci.mgmt.yml | 27 +++++++++++++++++++++++++++ sdk/attestation/pom.mgmt.xml | 14 ++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 sdk/attestation/ci.mgmt.yml create mode 100644 sdk/attestation/pom.mgmt.xml diff --git a/sdk/attestation/ci.mgmt.yml b/sdk/attestation/ci.mgmt.yml new file mode 100644 index 000000000000..1f31503f55f0 --- /dev/null +++ b/sdk/attestation/ci.mgmt.yml @@ -0,0 +1,27 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ + +stages: + - template: ../../eng/pipelines/templates/stages/archetype-sdk-management.yml + parameters: + ServiceDirectory: attestation diff --git a/sdk/attestation/pom.mgmt.xml b/sdk/attestation/pom.mgmt.xml new file mode 100644 index 000000000000..6b9317e297fb --- /dev/null +++ b/sdk/attestation/pom.mgmt.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-attestation-management + pom + 1.0.0 + + mgmt-v2020_10_01 + +