1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  *  http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 package software.amazon.awssdk.codegen.model.config.customization;
17 
18 /**
19  * Use operationModifiers customization to exclude a given operation, or add a
20  * wrapper around the result shape.
21  */
22 public class OperationModifier {
23 
24     private boolean exclude;
25 
26     private boolean useWrappingResult;
27     private String wrappedResultShape;
28     private String wrappedResultMember;
29 
30     /**
31      * @return true if this operation should be excluded when processing the
32      *         service model. When this option is set, both input and output
33      *         shapes are excluded too.
34      */
isExclude()35     public boolean isExclude() {
36         return exclude;
37     }
38 
setExclude(boolean exclude)39     public void setExclude(boolean exclude) {
40         this.exclude = exclude;
41     }
42 
43     /**
44      * @return true if the output shape of this operation is a thin wrapper
45      *         around the real logical result (e.g., EC2 Reservation wrapped by
46      *         RunInstancesResult), and that we want to directly return the
47      *         unwrapped result in the generated client.
48      */
isUseWrappingResult()49     public boolean isUseWrappingResult() {
50         return useWrappingResult;
51     }
52 
setUseWrappingResult(boolean useWrappingResult)53     public void setUseWrappingResult(boolean useWrappingResult) {
54         this.useWrappingResult = useWrappingResult;
55     }
56 
57     /**
58      * @return the shape of the member that represents the wrapped result.
59      * @see #isUseWrappingResult()
60      */
getWrappedResultShape()61     public String getWrappedResultShape() {
62         return wrappedResultShape;
63     }
64 
setWrappedResultShape(String wrappedResultShape)65     public void setWrappedResultShape(String wrappedResultShape) {
66         this.wrappedResultShape = wrappedResultShape;
67     }
68 
69     /**
70      * @return the name of the member that represents the wrapped result.
71      * @see #isUseWrappingResult()
72      */
getWrappedResultMember()73     public String getWrappedResultMember() {
74         return wrappedResultMember;
75     }
76 
setWrappedResultMember(String wrappedResultMember)77     public void setWrappedResultMember(String wrappedResultMember) {
78         this.wrappedResultMember = wrappedResultMember;
79     }
80 
81 }
82