class Phrase::TeamsApi
Attributes
Public Class Methods
# File lib/phrase/api/teams_api.rb, line 7 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Create a Team
Create a new Team
. @param account_id [String] Account
ID @param team_create_parameters [TeamCreateParameters] @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [TeamDetail]
# File lib/phrase/api/teams_api.rb, line 17 def team_create(account_id, team_create_parameters, opts = {}) data, _status_code, _headers = team_create_with_http_info(account_id, team_create_parameters, opts) data end
Create a Team
Create a new Team
. @param account_id [String] Account
ID @param team_create_parameters [TeamCreateParameters] @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [Array<(Response
<(TeamDetail
)>, Integer, Hash)>] Response
<(TeamDetail
)> data, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 29 def team_create_with_http_info(account_id, team_create_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.team_create ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.team_create" end # verify the required parameter 'team_create_parameters' is set if @api_client.config.client_side_validation && team_create_parameters.nil? fail ArgumentError, "Missing the required parameter 'team_create_parameters' when calling TeamsApi.team_create" end # resource path local_var_path = '/accounts/{account_id}/teams'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)) # 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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(team_create_parameters) # return_type return_type = opts[:return_type] || 'TeamDetail' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#team_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end
Delete Team
Delete the specified Team
. @param account_id [String] Account
ID @param id [String] ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [nil]
# File lib/phrase/api/teams_api.rb, line 91 def team_delete(account_id, id, opts = {}) data, _status_code, _headers = team_delete_with_http_info(account_id, id, opts) data end
Delete Team
Delete the specified Team
. @param account_id [String] Account
ID @param id [String] ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [Array<(Response
, Integer, Hash)>] Response
<(nil, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 103 def team_delete_with_http_info(account_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.team_delete ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.team_delete" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TeamsApi.team_delete" end # resource path local_var_path = '/accounts/{account_id}/teams/{team_id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#team_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end
Get Team
Show the specified Team
. @param account_id [String] Account
ID @param id [String] ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [TeamDetail]
# File lib/phrase/api/teams_api.rb, line 161 def team_show(account_id, id, opts = {}) data, _status_code, _headers = team_show_with_http_info(account_id, id, opts) data end
Get Team
Show the specified Team
. @param account_id [String] Account
ID @param id [String] ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [Array<(Response
<(TeamDetail
)>, Integer, Hash)>] Response
<(TeamDetail
)> data, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 173 def team_show_with_http_info(account_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.team_show ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.team_show" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TeamsApi.team_show" end # resource path local_var_path = '/accounts/{account_id}/teams/{team_id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # 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']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'TeamDetail' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#team_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end
Update Team
Update the specified Team
. @param account_id [String] Account
ID @param id [String] ID @param team_update_parameters [TeamUpdateParameters] @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [TeamDetail]
# File lib/phrase/api/teams_api.rb, line 234 def team_update(account_id, id, team_update_parameters, opts = {}) data, _status_code, _headers = team_update_with_http_info(account_id, id, team_update_parameters, opts) data end
Update Team
Update the specified Team
. @param account_id [String] Account
ID @param id [String] ID @param team_update_parameters [TeamUpdateParameters] @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [Array<(Response
<(TeamDetail
)>, Integer, Hash)>] Response
<(TeamDetail
)> data, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 247 def team_update_with_http_info(account_id, id, team_update_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.team_update ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.team_update" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TeamsApi.team_update" end # verify the required parameter 'team_update_parameters' is set if @api_client.config.client_side_validation && team_update_parameters.nil? fail ArgumentError, "Missing the required parameter 'team_update_parameters' when calling TeamsApi.team_update" end # resource path local_var_path = '/accounts/{account_id}/teams/{team_id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # 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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(team_update_parameters) # return_type return_type = opts[:return_type] || 'TeamDetail' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#team_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end
List Teams List all Teams for the given account. @param account_id [String] Account
ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @option opts [Integer] :page Page number @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default @return [Array<Team>]
# File lib/phrase/api/teams_api.rb, line 314 def teams_list(account_id, opts = {}) data, _status_code, _headers = teams_list_with_http_info(account_id, opts) data end
List Teams List all Teams for the given account. @param account_id [String] Account
ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @option opts [Integer] :page Page number @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default @return [Array<(Response
<(Array<Team>)>, Integer, Hash)>] Response
<(Array<Team>)> data, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 327 def teams_list_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_list ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.teams_list" end # resource path local_var_path = '/accounts/{account_id}/teams'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Array<Team>' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) 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 response = ::Phrase::Response.new(data, headers) return response, status_code, headers end
Add Project
Adds an existing project to the team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param teams_projects_create_parameters [TeamsProjectsCreateParameters] @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [nil]
# File lib/phrase/api/teams_api.rb, line 386 def teams_projects_create(account_id, team_id, teams_projects_create_parameters, opts = {}) data, _status_code, _headers = teams_projects_create_with_http_info(account_id, team_id, teams_projects_create_parameters, opts) data end
Add Project
Adds an existing project to the team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param teams_projects_create_parameters [TeamsProjectsCreateParameters] @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [Array<(Response
, Integer, Hash)>] Response
<(nil, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 399 def teams_projects_create_with_http_info(account_id, team_id, teams_projects_create_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_projects_create ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.teams_projects_create" 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 TeamsApi.teams_projects_create" end # verify the required parameter 'teams_projects_create_parameters' is set if @api_client.config.client_side_validation && teams_projects_create_parameters.nil? fail ArgumentError, "Missing the required parameter 'teams_projects_create_parameters' when calling TeamsApi.teams_projects_create" end # resource path local_var_path = '/accounts/{account_id}/teams/{team_id}/projects'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(teams_projects_create_parameters) # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_projects_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end
Remove Project
Removes a specified project from the specified team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param id [String] ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [nil]
# File lib/phrase/api/teams_api.rb, line 464 def teams_projects_delete(account_id, team_id, id, opts = {}) data, _status_code, _headers = teams_projects_delete_with_http_info(account_id, team_id, id, opts) data end
Remove Project
Removes a specified project from the specified team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param id [String] ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [Array<(Response
, Integer, Hash)>] Response
<(nil, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 477 def teams_projects_delete_with_http_info(account_id, team_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_projects_delete ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.teams_projects_delete" 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 TeamsApi.teams_projects_delete" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TeamsApi.teams_projects_delete" end # resource path local_var_path = '/accounts/{account_id}/teams/{team_id}/projects/{id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_projects_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end
Add Space
Adds an existing space to the team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param teams_spaces_create_parameters [TeamsSpacesCreateParameters] @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [nil]
# File lib/phrase/api/teams_api.rb, line 540 def teams_spaces_create(account_id, team_id, teams_spaces_create_parameters, opts = {}) data, _status_code, _headers = teams_spaces_create_with_http_info(account_id, team_id, teams_spaces_create_parameters, opts) data end
Add Space
Adds an existing space to the team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param teams_spaces_create_parameters [TeamsSpacesCreateParameters] @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [Array<(Response
, Integer, Hash)>] Response
<(nil, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 553 def teams_spaces_create_with_http_info(account_id, team_id, teams_spaces_create_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_spaces_create ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.teams_spaces_create" 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 TeamsApi.teams_spaces_create" end # verify the required parameter 'teams_spaces_create_parameters' is set if @api_client.config.client_side_validation && teams_spaces_create_parameters.nil? fail ArgumentError, "Missing the required parameter 'teams_spaces_create_parameters' when calling TeamsApi.teams_spaces_create" end # resource path local_var_path = '/accounts/{account_id}/teams/{team_id}/spaces'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(teams_spaces_create_parameters) # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_spaces_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end
Remove Space
Removes a specified space from the specified team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param id [String] ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [nil]
# File lib/phrase/api/teams_api.rb, line 618 def teams_spaces_delete(account_id, team_id, id, opts = {}) data, _status_code, _headers = teams_spaces_delete_with_http_info(account_id, team_id, id, opts) data end
Remove Space
Removes a specified space from the specified team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param id [String] ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [Array<(Response
, Integer, Hash)>] Response
<(nil, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 631 def teams_spaces_delete_with_http_info(account_id, team_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_spaces_delete ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.teams_spaces_delete" 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 TeamsApi.teams_spaces_delete" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TeamsApi.teams_spaces_delete" end # resource path local_var_path = '/accounts/{account_id}/teams/{team_id}/spaces/{id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_spaces_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end
Add User
Adds an existing user to the team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param teams_users_create_parameters [TeamsUsersCreateParameters] @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [nil]
# File lib/phrase/api/teams_api.rb, line 694 def teams_users_create(account_id, team_id, teams_users_create_parameters, opts = {}) data, _status_code, _headers = teams_users_create_with_http_info(account_id, team_id, teams_users_create_parameters, opts) data end
Add User
Adds an existing user to the team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param teams_users_create_parameters [TeamsUsersCreateParameters] @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [Array<(Response
, Integer, Hash)>] Response
<(nil, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 707 def teams_users_create_with_http_info(account_id, team_id, teams_users_create_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_users_create ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.teams_users_create" 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 TeamsApi.teams_users_create" end # verify the required parameter 'teams_users_create_parameters' is set if @api_client.config.client_side_validation && teams_users_create_parameters.nil? fail ArgumentError, "Missing the required parameter 'teams_users_create_parameters' when calling TeamsApi.teams_users_create" end # resource path local_var_path = '/accounts/{account_id}/teams/{team_id}/users'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(teams_users_create_parameters) # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_users_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end
Remove User
Removes a specified user from the specified team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param id [String] ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [nil]
# File lib/phrase/api/teams_api.rb, line 772 def teams_users_delete(account_id, team_id, id, opts = {}) data, _status_code, _headers = teams_users_delete_with_http_info(account_id, team_id, id, opts) data end
Remove User
Removes a specified user from the specified team. @param account_id [String] Account
ID @param team_id [String] Team
ID @param id [String] ID @param [Hash] opts the optional parameters @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) @return [Array<(Response
, Integer, Hash)>] Response
<(nil, response status code and response headers
# File lib/phrase/api/teams_api.rb, line 785 def teams_users_delete_with_http_info(account_id, team_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeamsApi.teams_users_delete ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling TeamsApi.teams_users_delete" 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 TeamsApi.teams_users_delete" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling TeamsApi.teams_users_delete" end # resource path local_var_path = '/accounts/{account_id}/teams/{team_id}/users/{id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TeamsApi#teams_users_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end