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

com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.security.models.CloudName;
import com.azure.resourcemanager.security.models.CloudOffering;
import com.azure.resourcemanager.security.models.EnvironmentData;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/**
 * The security connector resource.
 */
@Fluent
public final class SecurityConnectorInner extends Resource {
    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    private SystemData systemData;

    /*
     * Security connector data
     */
    private SecurityConnectorProperties innerProperties;

    /*
     * The type of the resource.
     */
    private String type;

    /*
     * The name of the resource.
     */
    private String name;

    /*
     * Fully qualified resource Id for the resource.
     */
    private String id;

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

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     * 
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the innerProperties property: Security connector data.
     * 
     * @return the innerProperties value.
     */
    private SecurityConnectorProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the type property: The type of the resource.
     * 
     * @return the type value.
     */
    @Override
    public String type() {
        return this.type;
    }

    /**
     * Get the name property: The name of the resource.
     * 
     * @return the name value.
     */
    @Override
    public String name() {
        return this.name;
    }

    /**
     * Get the id property: Fully qualified resource Id for the resource.
     * 
     * @return the id value.
     */
    @Override
    public String id() {
        return this.id;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public SecurityConnectorInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public SecurityConnectorInner withTags(Map tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector,
     * project number in case of GCP connector).
     * 
     * @return the hierarchyIdentifier value.
     */
    public String hierarchyIdentifier() {
        return this.innerProperties() == null ? null : this.innerProperties().hierarchyIdentifier();
    }

    /**
     * Set the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector,
     * project number in case of GCP connector).
     * 
     * @param hierarchyIdentifier the hierarchyIdentifier value to set.
     * @return the SecurityConnectorInner object itself.
     */
    public SecurityConnectorInner withHierarchyIdentifier(String hierarchyIdentifier) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityConnectorProperties();
        }
        this.innerProperties().withHierarchyIdentifier(hierarchyIdentifier);
        return this;
    }

    /**
     * Get the hierarchyIdentifierTrialEndDate property: The date on which the trial period will end, if applicable.
     * Trial period exists for 30 days after upgrading to payed offerings.
     * 
     * @return the hierarchyIdentifierTrialEndDate value.
     */
    public OffsetDateTime hierarchyIdentifierTrialEndDate() {
        return this.innerProperties() == null ? null : this.innerProperties().hierarchyIdentifierTrialEndDate();
    }

    /**
     * Get the environmentName property: The multi cloud resource's cloud name.
     * 
     * @return the environmentName value.
     */
    public CloudName environmentName() {
        return this.innerProperties() == null ? null : this.innerProperties().environmentName();
    }

    /**
     * Set the environmentName property: The multi cloud resource's cloud name.
     * 
     * @param environmentName the environmentName value to set.
     * @return the SecurityConnectorInner object itself.
     */
    public SecurityConnectorInner withEnvironmentName(CloudName environmentName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityConnectorProperties();
        }
        this.innerProperties().withEnvironmentName(environmentName);
        return this;
    }

    /**
     * Get the offerings property: A collection of offerings for the security connector.
     * 
     * @return the offerings value.
     */
    public List offerings() {
        return this.innerProperties() == null ? null : this.innerProperties().offerings();
    }

    /**
     * Set the offerings property: A collection of offerings for the security connector.
     * 
     * @param offerings the offerings value to set.
     * @return the SecurityConnectorInner object itself.
     */
    public SecurityConnectorInner withOfferings(List offerings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityConnectorProperties();
        }
        this.innerProperties().withOfferings(offerings);
        return this;
    }

    /**
     * Get the environmentData property: The security connector environment data.
     * 
     * @return the environmentData value.
     */
    public EnvironmentData environmentData() {
        return this.innerProperties() == null ? null : this.innerProperties().environmentData();
    }

    /**
     * Set the environmentData property: The security connector environment data.
     * 
     * @param environmentData the environmentData value to set.
     * @return the SecurityConnectorInner object itself.
     */
    public SecurityConnectorInner withEnvironmentData(EnvironmentData environmentData) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityConnectorProperties();
        }
        this.innerProperties().withEnvironmentData(environmentData);
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("location", location());
        jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedSecurityConnectorInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedSecurityConnectorInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedSecurityConnectorInner.type = reader.getString();
                } else if ("location".equals(fieldName)) {
                    deserializedSecurityConnectorInner.withLocation(reader.getString());
                } else if ("tags".equals(fieldName)) {
                    Map tags = reader.readMap(reader1 -> reader1.getString());
                    deserializedSecurityConnectorInner.withTags(tags);
                } else if ("systemData".equals(fieldName)) {
                    deserializedSecurityConnectorInner.systemData = SystemData.fromJson(reader);
                } else if ("properties".equals(fieldName)) {
                    deserializedSecurityConnectorInner.innerProperties = SecurityConnectorProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSecurityConnectorInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy