Class: SwaggerClient::StaffApi

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_client/api/staff_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ StaffApi

Returns a new instance of StaffApi.



19
20
21
# File 'lib/swagger_client/api/staff_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/swagger_client/api/staff_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#staff_get_staff(site_id, version, opts = {}) ⇒ GetStaffResponse

Get staff members at a site.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

  • :request_filters (Array<String>)

    Filters to apply to the search. Possible values are: * StaffViewable * AppointmentInstructor * ClassInstructor * Male * Female

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_location_id (Integer)

    Return only staff members that are available at the specified location. You must supply a valid &#x60;SessionTypeID&#x60; and &#x60;StartDateTime&#x60; to use this parameter.

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_session_type_id (Integer)

    Return only staff members that are available for the specified session type. You must supply a valid &#x60;StartDateTime&#x60; and &#x60;LocationID&#x60; to use this parameter.

  • :request_staff_ids (Array<Integer>)

    A list of the requested staff IDs.

  • :request_start_date_time (DateTime)

    Return only staff members that are available at the specified date and time. You must supply a valid &#x60;SessionTypeID&#x60; and &#x60;LocationID&#x60; to use this parameter.

Returns:



35
36
37
38
# File 'lib/swagger_client/api/staff_api.rb', line 35

def staff_get_staff(site_id, version, opts = {})
  data, _status_code, _headers = staff_get_staff_with_http_info(site_id, version, opts)
  data
end

#staff_get_staff_permissions(request_staff_id, site_id, version, opts = {}) ⇒ GetStaffPermissionsResponse

Get configured staff permissions for a staff member.

Parameters:

  • request_staff_id

    The ID of the staff member whose permissions you want to return.

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

Returns:



110
111
112
113
# File 'lib/swagger_client/api/staff_api.rb', line 110

def staff_get_staff_permissions(request_staff_id, site_id, version, opts = {})
  data, _status_code, _headers = staff_get_staff_permissions_with_http_info(request_staff_id, site_id, version, opts)
  data
end

#staff_get_staff_permissions_with_http_info(request_staff_id, site_id, version, opts = {}) ⇒ Array<(GetStaffPermissionsResponse, Fixnum, Hash)>

Get configured staff permissions for a staff member.

Parameters:

  • request_staff_id

    The ID of the staff member whose permissions you want to return.

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

Returns:



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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/swagger_client/api/staff_api.rb', line 122

def staff_get_staff_permissions_with_http_info(request_staff_id, site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StaffApi.staff_get_staff_permissions ...'
  end
  # verify the required parameter 'request_staff_id' is set
  if @api_client.config.client_side_validation && request_staff_id.nil?
    fail ArgumentError, "Missing the required parameter 'request_staff_id' when calling StaffApi.staff_get_staff_permissions"
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling StaffApi.staff_get_staff_permissions"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling StaffApi.staff_get_staff_permissions"
  end
  # resource path
  local_var_path = '/public/v{version}/staff/staffpermissions'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.staffId'] = request_staff_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'GetStaffPermissionsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StaffApi#staff_get_staff_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#staff_get_staff_with_http_info(site_id, version, opts = {}) ⇒ Array<(GetStaffResponse, Fixnum, Hash)>

Get staff members at a site.

Parameters:

  • site_id

    ID of the site from which to pull data.

  • version
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

  • :request_filters (Array<String>)

    Filters to apply to the search. Possible values are: * StaffViewable * AppointmentInstructor * ClassInstructor * Male * Female

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_location_id (Integer)

    Return only staff members that are available at the specified location. You must supply a valid &#x60;SessionTypeID&#x60; and &#x60;StartDateTime&#x60; to use this parameter.

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_session_type_id (Integer)

    Return only staff members that are available for the specified session type. You must supply a valid &#x60;StartDateTime&#x60; and &#x60;LocationID&#x60; to use this parameter.

  • :request_staff_ids (Array<Integer>)

    A list of the requested staff IDs.

  • :request_start_date_time (DateTime)

    Return only staff members that are available at the specified date and time. You must supply a valid &#x60;SessionTypeID&#x60; and &#x60;LocationID&#x60; to use this parameter.

Returns:

  • (Array<(GetStaffResponse, Fixnum, Hash)>)

    GetStaffResponse data, response status code and response headers



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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/swagger_client/api/staff_api.rb', line 53

def staff_get_staff_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StaffApi.staff_get_staff ...'
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling StaffApi.staff_get_staff"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling StaffApi.staff_get_staff"
  end
  # resource path
  local_var_path = '/public/v{version}/staff/staff'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.filters'] = @api_client.build_collection_param(opts[:'request_filters'], :multi) if !opts[:'request_filters'].nil?
  query_params[:'request.limit'] = opts[:'request_limit'] if !opts[:'request_limit'].nil?
  query_params[:'request.locationId'] = opts[:'request_location_id'] if !opts[:'request_location_id'].nil?
  query_params[:'request.offset'] = opts[:'request_offset'] if !opts[:'request_offset'].nil?
  query_params[:'request.sessionTypeId'] = opts[:'request_session_type_id'] if !opts[:'request_session_type_id'].nil?
  query_params[:'request.staffIds'] = @api_client.build_collection_param(opts[:'request_staff_ids'], :multi) if !opts[:'request_staff_ids'].nil?
  query_params[:'request.startDateTime'] = opts[:'request_start_date_time'] if !opts[:'request_start_date_time'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'GetStaffResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StaffApi#staff_get_staff\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end