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

package com.azure.resourcemanager.resourcehealth.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.resourcehealth.models.KeyValueItem;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Properties of impacted resource. */
@Fluent
public final class EventImpactedResourceProperties {
    /*
     * Resource type within Microsoft cloud.
     */
    @JsonProperty(value = "targetResourceType", access = JsonProperty.Access.WRITE_ONLY)
    private String targetResourceType;

    /*
     * Identity for resource within Microsoft cloud.
     */
    @JsonProperty(value = "targetResourceId", access = JsonProperty.Access.WRITE_ONLY)
    private String targetResourceId;

    /*
     * Impacted resource region name.
     */
    @JsonProperty(value = "targetRegion", access = JsonProperty.Access.WRITE_ONLY)
    private String targetRegion;

    /*
     * Additional information.
     */
    @JsonProperty(value = "info")
    private List<KeyValueItem> info;

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

    /**
     * Get the targetResourceType property: Resource type within Microsoft cloud.
     *
     * @return the targetResourceType value.
     */
    public String targetResourceType() {
        return this.targetResourceType;
    }

    /**
     * Get the targetResourceId property: Identity for resource within Microsoft cloud.
     *
     * @return the targetResourceId value.
     */
    public String targetResourceId() {
        return this.targetResourceId;
    }

    /**
     * Get the targetRegion property: Impacted resource region name.
     *
     * @return the targetRegion value.
     */
    public String targetRegion() {
        return this.targetRegion;
    }

    /**
     * Get the info property: Additional information.
     *
     * @return the info value.
     */
    public List<KeyValueItem> info() {
        return this.info;
    }

    /**
     * Set the info property: Additional information.
     *
     * @param info the info value to set.
     * @return the EventImpactedResourceProperties object itself.
     */
    public EventImpactedResourceProperties withInfo(List<KeyValueItem> info) {
        this.info = info;
        return this;
    }

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