All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.security.models.AwsOrganizationalDataMember Maven / Gradle / Ivy

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.security.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * The AWS organization data for the member account.
 */
@Fluent
public final class AwsOrganizationalDataMember extends AwsOrganizationalData {
    /*
     * The multi cloud account's membership type in the organization
     */
    private OrganizationMembershipType organizationMembershipType = OrganizationMembershipType.MEMBER;

    /*
     * If the multi cloud account is not of membership type organization, this will be the ID of the account's parent
     */
    private String parentHierarchyId;

    /**
     * Creates an instance of AwsOrganizationalDataMember class.
     */
    public AwsOrganizationalDataMember() {
    }

    /**
     * Get the organizationMembershipType property: The multi cloud account's membership type in the organization.
     * 
     * @return the organizationMembershipType value.
     */
    @Override
    public OrganizationMembershipType organizationMembershipType() {
        return this.organizationMembershipType;
    }

    /**
     * Get the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will
     * be the ID of the account's parent.
     * 
     * @return the parentHierarchyId value.
     */
    public String parentHierarchyId() {
        return this.parentHierarchyId;
    }

    /**
     * Set the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will
     * be the ID of the account's parent.
     * 
     * @param parentHierarchyId the parentHierarchyId value to set.
     * @return the AwsOrganizationalDataMember object itself.
     */
    public AwsOrganizationalDataMember withParentHierarchyId(String parentHierarchyId) {
        this.parentHierarchyId = parentHierarchyId;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("organizationMembershipType",
            this.organizationMembershipType == null ? null : this.organizationMembershipType.toString());
        jsonWriter.writeStringField("parentHierarchyId", this.parentHierarchyId);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of AwsOrganizationalDataMember from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of AwsOrganizationalDataMember if the JsonReader was pointing to an instance of it, or null
     * if it was pointing to JSON null.
     * @throws IOException If an error occurs while reading the AwsOrganizationalDataMember.
     */
    public static AwsOrganizationalDataMember fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            AwsOrganizationalDataMember deserializedAwsOrganizationalDataMember = new AwsOrganizationalDataMember();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("organizationMembershipType".equals(fieldName)) {
                    deserializedAwsOrganizationalDataMember.organizationMembershipType
                        = OrganizationMembershipType.fromString(reader.getString());
                } else if ("parentHierarchyId".equals(fieldName)) {
                    deserializedAwsOrganizationalDataMember.parentHierarchyId = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAwsOrganizationalDataMember;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy