=begin #SignRequest API #API for SignRequest.com OpenAPI spec version: v1 Contact: tech-support@signrequest.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.8 =end require 'uri' module SignRequestClient class TeamsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param data # @param [Hash] opts the optional parameters # @return [Team] def teams_create(data, opts = {}) data, _status_code, _headers = teams_create_with_http_info(data, opts) data end # Create a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param data # @param [Hash] opts the optional parameters # @return [Array<(Team, Fixnum, Hash)>] Team data, response status code and response headers def teams_create_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_create ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling TeamsApi.teams_create" end # resource path local_var_path = '/teams/' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(data) auth_names = ['Token'] 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 => 'Team') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain # @param [Hash] opts the optional parameters # @return [nil] def teams_delete(subdomain, opts = {}) teams_delete_with_http_info(subdomain, opts) nil end # Delete a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def teams_delete_with_http_info(subdomain, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_delete ...' end # verify the required parameter 'subdomain' is set if @api_client.config.client_side_validation && subdomain.nil? fail ArgumentError, "Missing the required parameter 'subdomain' when calling TeamsApi.teams_delete" end # resource path local_var_path = '/teams/{subdomain}/'.sub('{' + 'subdomain' + '}', subdomain.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Invite a Team Member # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain # @param data # @param [Hash] opts the optional parameters # @return [InviteMember] def teams_invite_member(subdomain, data, opts = {}) data, _status_code, _headers = teams_invite_member_with_http_info(subdomain, data, opts) data end # Invite a Team Member # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain # @param data # @param [Hash] opts the optional parameters # @return [Array<(InviteMember, Fixnum, Hash)>] InviteMember data, response status code and response headers def teams_invite_member_with_http_info(subdomain, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_invite_member ...' end # verify the required parameter 'subdomain' is set if @api_client.config.client_side_validation && subdomain.nil? fail ArgumentError, "Missing the required parameter 'subdomain' when calling TeamsApi.teams_invite_member" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling TeamsApi.teams_invite_member" end # resource path local_var_path = '/teams/{subdomain}/invite_member/'.sub('{' + 'subdomain' + '}', subdomain.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(data) auth_names = ['Token'] 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 => 'InviteMember') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_invite_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a list of Teams # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param [Hash] opts the optional parameters # @option opts [Integer] :page A page number within the paginated result set. # @option opts [Integer] :limit Number of results to return per page. # @return [InlineResponse2007] def teams_list(opts = {}) data, _status_code, _headers = teams_list_with_http_info(opts) data end # Retrieve a list of Teams # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param [Hash] opts the optional parameters # @option opts [Integer] :page A page number within the paginated result set. # @option opts [Integer] :limit Number of results to return per page. # @return [Array<(InlineResponse2007, Fixnum, Hash)>] InlineResponse2007 data, response status code and response headers def teams_list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_list ...' end # resource path local_var_path = '/teams/' # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse2007') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain # @param data # @param [Hash] opts the optional parameters # @return [Team] def teams_partial_update(subdomain, data, opts = {}) data, _status_code, _headers = teams_partial_update_with_http_info(subdomain, data, opts) data end # Update a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain # @param data # @param [Hash] opts the optional parameters # @return [Array<(Team, Fixnum, Hash)>] Team data, response status code and response headers def teams_partial_update_with_http_info(subdomain, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_partial_update ...' end # verify the required parameter 'subdomain' is set if @api_client.config.client_side_validation && subdomain.nil? fail ArgumentError, "Missing the required parameter 'subdomain' when calling TeamsApi.teams_partial_update" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling TeamsApi.teams_partial_update" end # resource path local_var_path = '/teams/{subdomain}/'.sub('{' + 'subdomain' + '}', subdomain.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(data) auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Team') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain # @param [Hash] opts the optional parameters # @return [Team] def teams_read(subdomain, opts = {}) data, _status_code, _headers = teams_read_with_http_info(subdomain, opts) data end # Retrieve a Team # Required fields are **name** and **subdomain** where the subdomain is globally unique. Use **POST** to create a Team. To update a field on a Team use **PATCH**. To use the API on behalf of a particular team change the endpoint to: *https://**{{ subdomain }}**.signrequest.com/api/v1/...* To invite new team members you can use **POST** {\"email\":\"**email-of-member-to-invite@example.com**\",\"is_admin\":false,\"is_owner\":false} to: *https://signrequest.com/api/v1/teams/**{{ subdomain }}**/invite_member/* # @param subdomain # @param [Hash] opts the optional parameters # @return [Array<(Team, Fixnum, Hash)>] Team data, response status code and response headers def teams_read_with_http_info(subdomain, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_read ...' end # verify the required parameter 'subdomain' is set if @api_client.config.client_side_validation && subdomain.nil? fail ArgumentError, "Missing the required parameter 'subdomain' when calling TeamsApi.teams_read" end # resource path local_var_path = '/teams/{subdomain}/'.sub('{' + 'subdomain' + '}', subdomain.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Team') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end