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

package com.azure.resourcemanager.mediaservices.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Streaming endpoint access control definition. */
@Fluent
public final class StreamingEndpointAccessControl {
    /*
     * The access control of Akamai
     */
    @JsonProperty(value = "akamai")
    private AkamaiAccessControl akamai;

    /*
     * The IP access control of the streaming endpoint.
     */
    @JsonProperty(value = "ip")
    private IpAccessControl ip;

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

    /**
     * Get the akamai property: The access control of Akamai.
     *
     * @return the akamai value.
     */
    public AkamaiAccessControl akamai() {
        return this.akamai;
    }

    /**
     * Set the akamai property: The access control of Akamai.
     *
     * @param akamai the akamai value to set.
     * @return the StreamingEndpointAccessControl object itself.
     */
    public StreamingEndpointAccessControl withAkamai(AkamaiAccessControl akamai) {
        this.akamai = akamai;
        return this;
    }

    /**
     * Get the ip property: The IP access control of the streaming endpoint.
     *
     * @return the ip value.
     */
    public IpAccessControl ip() {
        return this.ip;
    }

    /**
     * Set the ip property: The IP access control of the streaming endpoint.
     *
     * @param ip the ip value to set.
     * @return the StreamingEndpointAccessControl object itself.
     */
    public StreamingEndpointAccessControl withIp(IpAccessControl ip) {
        this.ip = ip;
        return this;
    }

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