Class: RadioManagerClient::ProgramApi
- Inherits:
-
Object
- Object
- RadioManagerClient::ProgramApi
- Defined in:
- lib/radiomanager_client/api/program_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_program(data, opts = {}) ⇒ PostSuccess
Create program.
-
#create_program_with_http_info(data, opts = {}) ⇒ Array<(PostSuccess, Fixnum, Hash)>
Create program.
-
#delete_program_by_id(id, opts = {}) ⇒ Success
Delete program by id Delete program by id.
-
#delete_program_by_id_with_http_info(id, opts = {}) ⇒ Array<(Success, Fixnum, Hash)>
Delete program by id Delete program by id.
-
#get_program_by_id(id, opts = {}) ⇒ ProgramResult
Get program by id Get program by id.
-
#get_program_by_id_with_http_info(id, opts = {}) ⇒ Array<(ProgramResult, Fixnum, Hash)>
Get program by id Get program by id.
-
#initialize(api_client = ApiClient.default) ⇒ ProgramApi
constructor
A new instance of ProgramApi.
-
#list_programs(opts = {}) ⇒ ProgramResults
Get all programs.
-
#list_programs_with_http_info(opts = {}) ⇒ Array<(ProgramResults, Fixnum, Hash)>
Get all programs.
-
#update_program_by_id(id, opts = {}) ⇒ Success
Update program by id Update program by id.
-
#update_program_by_id_with_http_info(id, opts = {}) ⇒ Array<(Success, Fixnum, Hash)>
Update program by id Update program by id.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ProgramApi
Returns a new instance of ProgramApi.
19 20 21 |
# File 'lib/radiomanager_client/api/program_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/radiomanager_client/api/program_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_program(data, opts = {}) ⇒ PostSuccess
Create program. Create program.
28 29 30 31 |
# File 'lib/radiomanager_client/api/program_api.rb', line 28 def create_program(data, opts = {}) data, _status_code, _headers = create_program_with_http_info(data, opts) return data end |
#create_program_with_http_info(data, opts = {}) ⇒ Array<(PostSuccess, Fixnum, Hash)>
Create program. Create program.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/radiomanager_client/api/program_api.rb', line 38 def create_program_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProgramApi.create_program ..." 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 ProgramApi.create_program" end # resource path local_var_path = "/programs" # 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 = ['API Key'] 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 => 'PostSuccess') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProgramApi#create_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_program_by_id(id, opts = {}) ⇒ Success
Delete program by id Delete program by id
83 84 85 86 |
# File 'lib/radiomanager_client/api/program_api.rb', line 83 def delete_program_by_id(id, opts = {}) data, _status_code, _headers = delete_program_by_id_with_http_info(id, opts) return data end |
#delete_program_by_id_with_http_info(id, opts = {}) ⇒ Array<(Success, Fixnum, Hash)>
Delete program by id Delete program by id
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/radiomanager_client/api/program_api.rb', line 93 def delete_program_by_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProgramApi.delete_program_by_id ..." 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 ProgramApi.delete_program_by_id" end if @api_client.config.client_side_validation && id < 0 fail ArgumentError, 'invalid value for "id" when calling ProgramApi.delete_program_by_id, must be greater than or equal to 0.' end # resource path local_var_path = "/programs/{id}".sub('{' + 'id' + '}', id.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 = ['API Key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Success') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProgramApi#delete_program_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_program_by_id(id, opts = {}) ⇒ ProgramResult
Get program by id Get program by id
143 144 145 146 |
# File 'lib/radiomanager_client/api/program_api.rb', line 143 def get_program_by_id(id, opts = {}) data, _status_code, _headers = get_program_by_id_with_http_info(id, opts) return data end |
#get_program_by_id_with_http_info(id, opts = {}) ⇒ Array<(ProgramResult, Fixnum, Hash)>
Get program by id Get program by id
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/radiomanager_client/api/program_api.rb', line 154 def get_program_by_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProgramApi.get_program_by_id ..." 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 ProgramApi.get_program_by_id" end if @api_client.config.client_side_validation && id < 0 fail ArgumentError, 'invalid value for "id" when calling ProgramApi.get_program_by_id, must be greater than or equal to 0.' end # resource path local_var_path = "/programs/{id}".sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'_external_station_id'] = opts[:'_external_station_id'] if !opts[:'_external_station_id'].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 = ['API Key'] 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 => 'ProgramResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProgramApi#get_program_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_programs(opts = {}) ⇒ ProgramResults
Get all programs. List all programs.
212 213 214 215 |
# File 'lib/radiomanager_client/api/program_api.rb', line 212 def list_programs(opts = {}) data, _status_code, _headers = list_programs_with_http_info(opts) return data end |
#list_programs_with_http_info(opts = {}) ⇒ Array<(ProgramResults, Fixnum, Hash)>
Get all programs. List all programs.
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/radiomanager_client/api/program_api.rb', line 230 def list_programs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProgramApi.list_programs ..." end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ProgramApi.list_programs, must be greater than or equal to 0.' end # resource path local_var_path = "/programs" # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'genre_id'] = opts[:'genre_id'] if !opts[:'genre_id'].nil? query_params[:'model_type_id'] = opts[:'model_type_id'] if !opts[:'model_type_id'].nil? query_params[:'presenter_id'] = opts[:'presenter_id'] if !opts[:'presenter_id'].nil? query_params[:'tag_id'] = opts[:'tag_id'] if !opts[:'tag_id'].nil? query_params[:'broadcast_id'] = opts[:'broadcast_id'] if !opts[:'broadcast_id'].nil? query_params[:'item_id'] = opts[:'item_id'] if !opts[:'item_id'].nil? query_params[:'block_id'] = opts[:'block_id'] if !opts[:'block_id'].nil? query_params[:'_external_station_id'] = opts[:'_external_station_id'] if !opts[:'_external_station_id'].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 = ['API Key'] 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 => 'ProgramResults') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProgramApi#list_programs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_program_by_id(id, opts = {}) ⇒ Success
Update program by id Update program by id
285 286 287 288 |
# File 'lib/radiomanager_client/api/program_api.rb', line 285 def update_program_by_id(id, opts = {}) data, _status_code, _headers = update_program_by_id_with_http_info(id, opts) return data end |
#update_program_by_id_with_http_info(id, opts = {}) ⇒ Array<(Success, Fixnum, Hash)>
Update program by id Update program by id
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/radiomanager_client/api/program_api.rb', line 296 def update_program_by_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ProgramApi.update_program_by_id ..." 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 ProgramApi.update_program_by_id" end if @api_client.config.client_side_validation && id < 0 fail ArgumentError, 'invalid value for "id" when calling ProgramApi.update_program_by_id, must be greater than or equal to 0.' end # resource path local_var_path = "/programs/{id}".sub('{' + 'id' + '}', id.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(opts[:'data']) auth_names = ['API Key'] 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 => 'Success') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProgramApi#update_program_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |