=begin #Dropbox Sign API #Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.3.0 =end require 'cgi' module Dropbox end module Dropbox::Sign class TeamApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Add User to Team # Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. # @param team_add_member_request [TeamAddMemberRequest] # @param [Hash] opts the optional parameters # @option opts [String] :team_id The id of the team. # @return [TeamGetResponse] def team_add_member(team_add_member_request, opts = {}) data, _status_code, _headers = team_add_member_with_http_info(team_add_member_request, opts) data end # Add User to Team # Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. # @param team_add_member_request [TeamAddMemberRequest] # @param [Hash] opts the optional parameters # @option opts [String] :team_id The id of the team. # @return [Array<(TeamGetResponse, Integer, Hash)>] TeamGetResponse data, response status code and response headers def team_add_member_with_http_info(team_add_member_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamApi.team_add_member ...' end # verify the required parameter 'team_add_member_request' is set if @api_client.config.client_side_validation && team_add_member_request.nil? fail ArgumentError, "Missing the required parameter 'team_add_member_request' when calling TeamApi.team_add_member" end # resource path local_var_path = '/team/add_member' # query parameters query_params = opts[:query_params] || {} query_params[:'team_id'] = opts[:'team_id'] if !opts[:'team_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( team_add_member_request, Dropbox::Sign::TeamAddMemberRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'TeamGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"TeamApi.team_add_member", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::TeamGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamApi#team_add_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create Team # Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. # @param team_create_request [TeamCreateRequest] # @param [Hash] opts the optional parameters # @return [TeamGetResponse] def team_create(team_create_request, opts = {}) data, _status_code, _headers = team_create_with_http_info(team_create_request, opts) data end # Create Team # Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. # @param team_create_request [TeamCreateRequest] # @param [Hash] opts the optional parameters # @return [Array<(TeamGetResponse, Integer, Hash)>] TeamGetResponse data, response status code and response headers def team_create_with_http_info(team_create_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamApi.team_create ...' end # verify the required parameter 'team_create_request' is set if @api_client.config.client_side_validation && team_create_request.nil? fail ArgumentError, "Missing the required parameter 'team_create_request' when calling TeamApi.team_create" end # resource path local_var_path = '/team/create' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( team_create_request, Dropbox::Sign::TeamCreateRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'TeamGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"TeamApi.team_create", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::TeamGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamApi#team_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Team # Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). # @param [Hash] opts the optional parameters # @return [nil] def team_delete(opts = {}) team_delete_with_http_info(opts) nil end # Delete Team # Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def team_delete_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamApi.team_delete ...' end # resource path local_var_path = '/team/destroy' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"TeamApi.team_delete", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e end if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamApi#team_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Team # Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. # @param [Hash] opts the optional parameters # @return [TeamGetResponse] def team_get(opts = {}) data, _status_code, _headers = team_get_with_http_info(opts) data end # Get Team # Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. # @param [Hash] opts the optional parameters # @return [Array<(TeamGetResponse, Integer, Hash)>] TeamGetResponse data, response status code and response headers def team_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamApi.team_get ...' end # resource path local_var_path = '/team' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TeamGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"TeamApi.team_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::TeamGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamApi#team_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Team Info # Provides information about a team. # @param [Hash] opts the optional parameters # @option opts [String] :team_id The id of the team. # @return [TeamGetInfoResponse] def team_info(opts = {}) data, _status_code, _headers = team_info_with_http_info(opts) data end # Get Team Info # Provides information about a team. # @param [Hash] opts the optional parameters # @option opts [String] :team_id The id of the team. # @return [Array<(TeamGetInfoResponse, Integer, Hash)>] TeamGetInfoResponse data, response status code and response headers def team_info_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamApi.team_info ...' end # resource path local_var_path = '/team/info' # query parameters query_params = opts[:query_params] || {} query_params[:'team_id'] = opts[:'team_id'] if !opts[:'team_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TeamGetInfoResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"TeamApi.team_info", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::TeamGetInfoResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamApi#team_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Team Invites # Provides a list of team invites (and their roles). # @param [Hash] opts the optional parameters # @option opts [String] :email_address The email address for which to display the team invites. # @return [TeamInvitesResponse] def team_invites(opts = {}) data, _status_code, _headers = team_invites_with_http_info(opts) data end # List Team Invites # Provides a list of team invites (and their roles). # @param [Hash] opts the optional parameters # @option opts [String] :email_address The email address for which to display the team invites. # @return [Array<(TeamInvitesResponse, Integer, Hash)>] TeamInvitesResponse data, response status code and response headers def team_invites_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamApi.team_invites ...' end # resource path local_var_path = '/team/invites' # query parameters query_params = opts[:query_params] || {} query_params[:'email_address'] = opts[:'email_address'] if !opts[:'email_address'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TeamInvitesResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"TeamApi.team_invites", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::TeamInvitesResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamApi#team_invites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Team Members # Provides a paginated list of members (and their roles) that belong to a given team. # @param team_id [String] The id of the team that a member list is being requested from. # @param [Hash] opts the optional parameters # @option opts [Integer] :page Which page number of the team member list to return. Defaults to `1`. (default to 1) # @option opts [Integer] :page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (default to 20) # @return [TeamMembersResponse] def team_members(team_id, opts = {}) data, _status_code, _headers = team_members_with_http_info(team_id, opts) data end # List Team Members # Provides a paginated list of members (and their roles) that belong to a given team. # @param team_id [String] The id of the team that a member list is being requested from. # @param [Hash] opts the optional parameters # @option opts [Integer] :page Which page number of the team member list to return. Defaults to `1`. # @option opts [Integer] :page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. # @return [Array<(TeamMembersResponse, Integer, Hash)>] TeamMembersResponse data, response status code and response headers def team_members_with_http_info(team_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamApi.team_members ...' end # verify the required parameter 'team_id' is set if @api_client.config.client_side_validation && team_id.nil? fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamApi.team_members" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TeamApi.team_members, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TeamApi.team_members, must be greater than or equal to 1.' end # resource path local_var_path = '/team/members/{team_id}'.sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TeamMembersResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"TeamApi.team_members", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::TeamMembersResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamApi#team_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Remove User from Team # Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. # @param team_remove_member_request [TeamRemoveMemberRequest] # @param [Hash] opts the optional parameters # @return [TeamGetResponse] def team_remove_member(team_remove_member_request, opts = {}) data, _status_code, _headers = team_remove_member_with_http_info(team_remove_member_request, opts) data end # Remove User from Team # Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. # @param team_remove_member_request [TeamRemoveMemberRequest] # @param [Hash] opts the optional parameters # @return [Array<(TeamGetResponse, Integer, Hash)>] TeamGetResponse data, response status code and response headers def team_remove_member_with_http_info(team_remove_member_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamApi.team_remove_member ...' end # verify the required parameter 'team_remove_member_request' is set if @api_client.config.client_side_validation && team_remove_member_request.nil? fail ArgumentError, "Missing the required parameter 'team_remove_member_request' when calling TeamApi.team_remove_member" end # resource path local_var_path = '/team/remove_member' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( team_remove_member_request, Dropbox::Sign::TeamRemoveMemberRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'TeamGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"TeamApi.team_remove_member", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 201 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::TeamGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamApi#team_remove_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Sub Teams # Provides a paginated list of sub teams that belong to a given team. # @param team_id [String] The id of the parent Team. # @param [Hash] opts the optional parameters # @option opts [Integer] :page Which page number of the SubTeam List to return. Defaults to `1`. (default to 1) # @option opts [Integer] :page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (default to 20) # @return [TeamSubTeamsResponse] def team_sub_teams(team_id, opts = {}) data, _status_code, _headers = team_sub_teams_with_http_info(team_id, opts) data end # List Sub Teams # Provides a paginated list of sub teams that belong to a given team. # @param team_id [String] The id of the parent Team. # @param [Hash] opts the optional parameters # @option opts [Integer] :page Which page number of the SubTeam List to return. Defaults to `1`. # @option opts [Integer] :page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. # @return [Array<(TeamSubTeamsResponse, Integer, Hash)>] TeamSubTeamsResponse data, response status code and response headers def team_sub_teams_with_http_info(team_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamApi.team_sub_teams ...' end # verify the required parameter 'team_id' is set if @api_client.config.client_side_validation && team_id.nil? fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamApi.team_sub_teams" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TeamApi.team_sub_teams, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling TeamApi.team_sub_teams, must be greater than or equal to 1.' end # resource path local_var_path = '/team/sub_teams/{team_id}'.sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TeamSubTeamsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"TeamApi.team_sub_teams", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::TeamSubTeamsResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamApi#team_sub_teams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Team # Updates the name of your Team. # @param team_update_request [TeamUpdateRequest] # @param [Hash] opts the optional parameters # @return [TeamGetResponse] def team_update(team_update_request, opts = {}) data, _status_code, _headers = team_update_with_http_info(team_update_request, opts) data end # Update Team # Updates the name of your Team. # @param team_update_request [TeamUpdateRequest] # @param [Hash] opts the optional parameters # @return [Array<(TeamGetResponse, Integer, Hash)>] TeamGetResponse data, response status code and response headers def team_update_with_http_info(team_update_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamApi.team_update ...' end # verify the required parameter 'team_update_request' is set if @api_client.config.client_side_validation && team_update_request.nil? fail ArgumentError, "Missing the required parameter 'team_update_request' when calling TeamApi.team_update" end # resource path local_var_path = '/team' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( team_update_request, Dropbox::Sign::TeamUpdateRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'TeamGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"TeamApi.team_update", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::TeamGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamApi#team_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end