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

dev.openfga.sdk.api.configuration.ClientReadAuthorizationModelOptions Maven / Gradle / Ivy

/*
 * OpenFGA
 * A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar.
 *
 * The version of the OpenAPI document: 1.x
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package dev.openfga.sdk.api.configuration;

import static dev.openfga.sdk.util.StringUtil.isNullOrWhitespace;

import dev.openfga.sdk.errors.FgaInvalidParameterException;
import java.util.Map;

public class ClientReadAuthorizationModelOptions implements AdditionalHeadersSupplier {
    private Map additionalHeaders;
    private String authorizationModelId;

    public ClientReadAuthorizationModelOptions additionalHeaders(Map additionalHeaders) {
        this.additionalHeaders = additionalHeaders;
        return this;
    }

    @Override
    public Map getAdditionalHeaders() {
        return this.additionalHeaders;
    }

    public void assertValidAuthorizationModelId() throws FgaInvalidParameterException {
        if (isNullOrWhitespace(authorizationModelId)) {
            throw new FgaInvalidParameterException("authorizationModelId", "ClientConfiguration");
        }
    }

    public ClientReadAuthorizationModelOptions authorizationModelId(String authorizationModelId) {
        this.authorizationModelId = authorizationModelId;
        return this;
    }

    public String getAuthorizationModelId() {
        return authorizationModelId;
    }

    public String getAuthorizationModelIdChecked() throws FgaInvalidParameterException {
        assertValidAuthorizationModelId();
        return authorizationModelId;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy