|  | 
|  | 1 | +### WARNING: This file is auto-generated by our OpenAPI spec. Do not | 
|  | 2 | +### edit it manually. | 
|  | 3 | + | 
|  | 4 | +require_relative '../../resource_includes/response_helper' | 
|  | 5 | + | 
|  | 6 | +module Asana | 
|  | 7 | +  module Resources | 
|  | 8 | +    class GoalsBase < Resource | 
|  | 9 | + | 
|  | 10 | +      def self.inherited(base) | 
|  | 11 | +        Registry.register(base) | 
|  | 12 | +      end | 
|  | 13 | + | 
|  | 14 | +      class << self | 
|  | 15 | +        # Add a collaborator to a goal | 
|  | 16 | +        # | 
|  | 17 | + | 
|  | 18 | +        # options - [Hash] the request I/O options | 
|  | 19 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 20 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 21 | +        # data - [Hash] the attributes to POST | 
|  | 22 | +        def add_followers(client, options: {}, **data) | 
|  | 23 | +          path = "/goals/{goal_gid}/addFollowers" | 
|  | 24 | +          parse(client.post(path, body: data, options: options)).first | 
|  | 25 | +        end | 
|  | 26 | + | 
|  | 27 | +        # Add a subgoal to a parent goal | 
|  | 28 | +        # | 
|  | 29 | + | 
|  | 30 | +        # options - [Hash] the request I/O options | 
|  | 31 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 32 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 33 | +        # data - [Hash] the attributes to POST | 
|  | 34 | +        def add_subgoal(client, options: {}, **data) | 
|  | 35 | +          path = "/goals/{goal_gid}/addSubgoal" | 
|  | 36 | +          parse(client.post(path, body: data, options: options)).first | 
|  | 37 | +        end | 
|  | 38 | + | 
|  | 39 | +        # Add a project/portfolio as supporting work for a goal. | 
|  | 40 | +        # | 
|  | 41 | + | 
|  | 42 | +        # options - [Hash] the request I/O options | 
|  | 43 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 44 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 45 | +        # data - [Hash] the attributes to POST | 
|  | 46 | +        def add_supporting_work_for_goal(client, options: {}, **data) | 
|  | 47 | +          path = "/goals/{goal_gid}/addSupportingWork" | 
|  | 48 | +          parse(client.post(path, body: data, options: options)).first | 
|  | 49 | +        end | 
|  | 50 | + | 
|  | 51 | +        # Create a goal metric | 
|  | 52 | +        # | 
|  | 53 | + | 
|  | 54 | +        # options - [Hash] the request I/O options | 
|  | 55 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 56 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 57 | +        # data - [Hash] the attributes to POST | 
|  | 58 | +        def create_goal_metric(client, options: {}, **data) | 
|  | 59 | +          path = "/goals/{goal_gid}/setMetric" | 
|  | 60 | +          parse(client.post(path, body: data, options: options)).first | 
|  | 61 | +        end | 
|  | 62 | + | 
|  | 63 | +        # Delete a goal | 
|  | 64 | +        # | 
|  | 65 | +        # goal_gid - [str]  (required) Globally unique identifier for the goal. | 
|  | 66 | +        # options - [Hash] the request I/O options | 
|  | 67 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 68 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 69 | +        def delete_goal(client, goal_gid: required("goal_gid"), options: {}) | 
|  | 70 | +          path = "/goals/{goal_gid}" | 
|  | 71 | +          path["{goal_gid}"] = goal_gid | 
|  | 72 | +          parse(client.delete(path, options: options)).first | 
|  | 73 | +        end | 
|  | 74 | + | 
|  | 75 | +        # Get a goal | 
|  | 76 | +        # | 
|  | 77 | +        # goal_gid - [str]  (required) Globally unique identifier for the goal. | 
|  | 78 | +        # options - [Hash] the request I/O options | 
|  | 79 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 80 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 81 | +        def get_goal(client, goal_gid: required("goal_gid"), options: {}) | 
|  | 82 | +          path = "/goals/{goal_gid}" | 
|  | 83 | +          path["{goal_gid}"] = goal_gid | 
|  | 84 | +          parse(client.get(path, options: options)).first | 
|  | 85 | +        end | 
|  | 86 | + | 
|  | 87 | +        # Get goals | 
|  | 88 | +        # | 
|  | 89 | + | 
|  | 90 | +        # portfolio - [str]  Globally unique identifier for supporting portfolio. | 
|  | 91 | +        # project - [str]  Globally unique identifier for supporting project. | 
|  | 92 | +        # is_workspace_level - [bool]  Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter. | 
|  | 93 | +        # team - [str]  Globally unique identifier for the team. | 
|  | 94 | +        # workspace - [str]  Globally unique identifier for the workspace. | 
|  | 95 | +        # options - [Hash] the request I/O options | 
|  | 96 | +        # > offset - [str]  Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' | 
|  | 97 | +        # > limit - [int]  Results per page. The number of objects to return per page. The value must be between 1 and 100. | 
|  | 98 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 99 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 100 | +        def get_goals(client, portfolio: nil, project: nil, is_workspace_level: nil, team: nil, workspace: nil, options: {}) | 
|  | 101 | +          path = "/goals" | 
|  | 102 | +          params = { portfolio: portfolio, project: project, is_workspace_level: is_workspace_level, team: team, workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? } | 
|  | 103 | +          Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client) | 
|  | 104 | +        end | 
|  | 105 | + | 
|  | 106 | +        # Get parent goals from a goal | 
|  | 107 | +        # | 
|  | 108 | + | 
|  | 109 | +        # options - [Hash] the request I/O options | 
|  | 110 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 111 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 112 | +        def get_parent_goals_for_goal(client, options: {}) | 
|  | 113 | +          path = "/goals/{goal_gid}/parentGoals" | 
|  | 114 | +          Collection.new(parse(client.get(path, options: options)), type: Resource, client: client) | 
|  | 115 | +        end | 
|  | 116 | + | 
|  | 117 | +        # Get subgoals from a goal | 
|  | 118 | +        # | 
|  | 119 | + | 
|  | 120 | +        # options - [Hash] the request I/O options | 
|  | 121 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 122 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 123 | +        def get_subgoals_for_goal(client, options: {}) | 
|  | 124 | +          path = "/goals/{goal_gid}/subgoals" | 
|  | 125 | +          Collection.new(parse(client.get(path, options: options)), type: Resource, client: client) | 
|  | 126 | +        end | 
|  | 127 | + | 
|  | 128 | +        # Remove a collaborator from a goal | 
|  | 129 | +        # | 
|  | 130 | + | 
|  | 131 | +        # options - [Hash] the request I/O options | 
|  | 132 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 133 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 134 | +        # data - [Hash] the attributes to POST | 
|  | 135 | +        def remove_followers(client, options: {}, **data) | 
|  | 136 | +          path = "/goals/{goal_gid}/removeFollowers" | 
|  | 137 | +          parse(client.post(path, body: data, options: options)).first | 
|  | 138 | +        end | 
|  | 139 | + | 
|  | 140 | +        # Remove a subgoal from a goal | 
|  | 141 | +        # | 
|  | 142 | + | 
|  | 143 | +        # options - [Hash] the request I/O options | 
|  | 144 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 145 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 146 | +        # data - [Hash] the attributes to POST | 
|  | 147 | +        def remove_subgoal(client, options: {}, **data) | 
|  | 148 | +          path = "/goals/{goal_gid}/removeSubgoal" | 
|  | 149 | +          parse(client.post(path, body: data, options: options)).first | 
|  | 150 | +        end | 
|  | 151 | + | 
|  | 152 | +        # Remove a project/portfolio as supporting work for a goal. | 
|  | 153 | +        # | 
|  | 154 | + | 
|  | 155 | +        # options - [Hash] the request I/O options | 
|  | 156 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 157 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 158 | +        # data - [Hash] the attributes to POST | 
|  | 159 | +        def remove_supporting_work_for_goal(client, options: {}, **data) | 
|  | 160 | +          path = "/goals/{goal_gid}/removeSupportingWork" | 
|  | 161 | +          parse(client.post(path, body: data, options: options)).first | 
|  | 162 | +        end | 
|  | 163 | + | 
|  | 164 | +        # Get supporting work from a goal | 
|  | 165 | +        # | 
|  | 166 | + | 
|  | 167 | +        # options - [Hash] the request I/O options | 
|  | 168 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 169 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 170 | +        def supporting_work(client, options: {}) | 
|  | 171 | +          path = "/goals/{goal_gid}/supportingWork" | 
|  | 172 | +          Collection.new(parse(client.get(path, options: options)), type: Project, client: client) | 
|  | 173 | +        end | 
|  | 174 | + | 
|  | 175 | +        # Update a goal | 
|  | 176 | +        # | 
|  | 177 | +        # goal_gid - [str]  (required) Globally unique identifier for the goal. | 
|  | 178 | +        # options - [Hash] the request I/O options | 
|  | 179 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 180 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 181 | +        # data - [Hash] the attributes to PUT | 
|  | 182 | +        def update_goal(client, goal_gid: required("goal_gid"), options: {}, **data) | 
|  | 183 | +          path = "/goals/{goal_gid}" | 
|  | 184 | +          path["{goal_gid}"] = goal_gid | 
|  | 185 | +          parse(client.put(path, body: data, options: options)).first | 
|  | 186 | +        end | 
|  | 187 | + | 
|  | 188 | +        # Update a goal metric | 
|  | 189 | +        # | 
|  | 190 | + | 
|  | 191 | +        # options - [Hash] the request I/O options | 
|  | 192 | +        # > opt_fields - [list[str]]  Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. | 
|  | 193 | +        # > opt_pretty - [bool]  Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. | 
|  | 194 | +        # data - [Hash] the attributes to POST | 
|  | 195 | +        def update_goal_metric(client, options: {}, **data) | 
|  | 196 | +          path = "/goals/{goal_gid}/setMetricCurrentValue" | 
|  | 197 | +          parse(client.post(path, body: data, options: options)).first | 
|  | 198 | +        end | 
|  | 199 | + | 
|  | 200 | +      end | 
|  | 201 | +    end | 
|  | 202 | +  end | 
|  | 203 | +end | 
0 commit comments