Class: OpsgenieSdk::TeamMemberApi
- Inherits:
-
Object
- Object
- OpsgenieSdk::TeamMemberApi
- Defined in:
- lib/opsgenie_sdk/api/team_member_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_team_member(identifier, body, opts = {}) ⇒ SuccessResponse
Add Team Member Adds a member to team with given identifier.
-
#add_team_member_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>
Add Team Member Adds a member to team with given identifier.
-
#delete_team_member(identifier, member_identifier, opts = {}) ⇒ SuccessResponse
Delete Team Member Deletes the member of team with given identifier.
-
#delete_team_member_with_http_info(identifier, member_identifier, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>
Delete Team Member Deletes the member of team with given identifier.
-
#initialize(api_client = ApiClient.default) ⇒ TeamMemberApi
constructor
A new instance of TeamMemberApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TeamMemberApi
Returns a new instance of TeamMemberApi.
19 20 21 |
# File 'lib/opsgenie_sdk/api/team_member_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/opsgenie_sdk/api/team_member_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#add_team_member(identifier, body, opts = {}) ⇒ SuccessResponse
Add Team Member Adds a member to team with given identifier
29 30 31 32 |
# File 'lib/opsgenie_sdk/api/team_member_api.rb', line 29 def add_team_member(identifier, body, opts = {}) data, _status_code, _headers = add_team_member_with_http_info(identifier, body, opts) data end |
#add_team_member_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>
Add Team Member Adds a member to team with given identifier
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/opsgenie_sdk/api/team_member_api.rb', line 41 def add_team_member_with_http_info(identifier, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamMemberApi.add_team_member ...' end # verify the required parameter 'identifier' is set if @api_client.config.client_side_validation && identifier.nil? fail ArgumentError, "Missing the required parameter 'identifier' when calling TeamMemberApi.add_team_member" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling TeamMemberApi.add_team_member" end if @api_client.config.client_side_validation && opts[:'team_identifier_type'] && !['id', 'name'].include?(opts[:'team_identifier_type']) fail ArgumentError, 'invalid value for "team_identifier_type", must be one of id, name' end # resource path local_var_path = '/v2/teams/{identifier}/members'.sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} query_params[:'teamIdentifierType'] = opts[:'team_identifier_type'] if !opts[:'team_identifier_type'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['GenieKey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SuccessResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamMemberApi#add_team_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_team_member(identifier, member_identifier, opts = {}) ⇒ SuccessResponse
Delete Team Member Deletes the member of team with given identifier
93 94 95 96 |
# File 'lib/opsgenie_sdk/api/team_member_api.rb', line 93 def delete_team_member(identifier, member_identifier, opts = {}) data, _status_code, _headers = delete_team_member_with_http_info(identifier, member_identifier, opts) data end |
#delete_team_member_with_http_info(identifier, member_identifier, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>
Delete Team Member Deletes the member of team with given identifier
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/opsgenie_sdk/api/team_member_api.rb', line 105 def delete_team_member_with_http_info(identifier, member_identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamMemberApi.delete_team_member ...' end # verify the required parameter 'identifier' is set if @api_client.config.client_side_validation && identifier.nil? fail ArgumentError, "Missing the required parameter 'identifier' when calling TeamMemberApi.delete_team_member" end # verify the required parameter 'member_identifier' is set if @api_client.config.client_side_validation && member_identifier.nil? fail ArgumentError, "Missing the required parameter 'member_identifier' when calling TeamMemberApi.delete_team_member" end if @api_client.config.client_side_validation && opts[:'team_identifier_type'] && !['id', 'name'].include?(opts[:'team_identifier_type']) fail ArgumentError, 'invalid value for "team_identifier_type", must be one of id, name' end # resource path local_var_path = '/v2/teams/{identifier}/members/{memberIdentifier}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'memberIdentifier' + '}', member_identifier.to_s) # query parameters query_params = {} query_params[:'teamIdentifierType'] = opts[:'team_identifier_type'] if !opts[:'team_identifier_type'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['GenieKey'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SuccessResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamMemberApi#delete_team_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |