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

software.amazon.awssdk.codegen.model.service.ServiceModel Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package software.amazon.awssdk.codegen.model.service;

import java.util.Collections;
import java.util.Map;

public class ServiceModel {

    private ServiceMetadata metadata;
    private Map operations;
    private Map shapes;
    private Map authorizers;
    private Map clientContextParams;

    private String documentation;

    public ServiceModel() {
    }

    public ServiceModel(ServiceMetadata metadata,
                        Map operations,
                        Map shapes,
                        Map authorizers) {
        this.metadata = metadata;
        this.operations = operations;
        this.shapes = shapes;
        this.authorizers = authorizers;
    }

    public ServiceMetadata getMetadata() {
        return metadata;
    }

    public void setMetadata(ServiceMetadata metadata) {
        this.metadata = metadata;
    }

    public Map getOperations() {
        return operations;
    }

    public void setOperations(Map operations) {
        this.operations = operations != null ? operations : Collections.emptyMap();
    }

    /**
     * Convenience getter to retrieve an {@link Operation} by name.
     *
     * @param operationName Name of operation to retrieve.
     * @return Operation or null if not found.
     */
    public Operation getOperation(String operationName) {
        return operations.get(operationName);
    }

    public Map getShapes() {
        return shapes;
    }

    public void setShapes(Map shapes) {
        this.shapes = shapes != null ? shapes : Collections.emptyMap();
    }

    /**
     * Convenience getter to retrieve a {@link Shape} by name.
     *
     * @param shapeName Name of shape to retrieve.
     * @return Shape or null if not found.
     */
    public Shape getShape(String shapeName) {
        return shapes.get(shapeName);
    }

    public String getDocumentation() {
        return documentation;
    }

    public void setDocumentation(String documentation) {
        this.documentation = documentation;
    }

    public Map getAuthorizers() {
        return authorizers != null ? authorizers : Collections.emptyMap();
    }

    public void setAuthorizers(Map authorizers) {
        this.authorizers = authorizers;
    }

    public Map getClientContextParams() {
        return clientContextParams;
    }

    public void setClientContextParams(Map clientContextParams) {
        this.clientContextParams = clientContextParams;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy