Class: DyspatchClient::LocalizationsApi
- Inherits:
-
Object
- Object
- DyspatchClient::LocalizationsApi
- Defined in:
- lib/dyspatch_client/api/localizations_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_draft_localization_by_id(draft_id, localization_id, target_language, accept, opts = {}) ⇒ LocalizationRead
Get Draft Localization Object by ID Returns a specific localization object of the matching draft with a matching localization ID.
-
#get_draft_localization_by_id_with_http_info(draft_id, localization_id, target_language, accept, opts = {}) ⇒ Array<(LocalizationRead, Integer, Hash)>
Get Draft Localization Object by ID Returns a specific localization object of the matching draft with a matching localization ID.
-
#get_published_localization_by_id(localization_id, target_language, accept, opts = {}) ⇒ LocalizationRead
Get Localization Object by ID Returns the published content associated with the localization of the matching ID.
-
#get_published_localization_by_id_with_http_info(localization_id, target_language, accept, opts = {}) ⇒ Array<(LocalizationRead, Integer, Hash)>
Get Localization Object by ID Returns the published content associated with the localization of the matching ID.
-
#initialize(api_client = ApiClient.default) ⇒ LocalizationsApi
constructor
A new instance of LocalizationsApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ LocalizationsApi
Returns a new instance of LocalizationsApi.
19 20 21 |
# File 'lib/dyspatch_client/api/localizations_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/dyspatch_client/api/localizations_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_draft_localization_by_id(draft_id, localization_id, target_language, accept, opts = {}) ⇒ LocalizationRead
Get Draft Localization Object by ID Returns a specific localization object of the matching draft with a matching localization ID
30 31 32 33 |
# File 'lib/dyspatch_client/api/localizations_api.rb', line 30 def get_draft_localization_by_id(draft_id, localization_id, target_language, accept, opts = {}) data, _status_code, _headers = get_draft_localization_by_id_with_http_info(draft_id, localization_id, target_language, accept, opts) data end |
#get_draft_localization_by_id_with_http_info(draft_id, localization_id, target_language, accept, opts = {}) ⇒ Array<(LocalizationRead, Integer, Hash)>
Get Draft Localization Object by ID Returns a specific localization object of the matching draft with a matching localization ID
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 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 103 104 105 106 107 |
# File 'lib/dyspatch_client/api/localizations_api.rb', line 43 def get_draft_localization_by_id_with_http_info(draft_id, localization_id, target_language, accept, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LocalizationsApi.get_draft_localization_by_id ...' end # verify the required parameter 'draft_id' is set if @api_client.config.client_side_validation && draft_id.nil? fail ArgumentError, "Missing the required parameter 'draft_id' when calling LocalizationsApi.get_draft_localization_by_id" end # verify the required parameter 'localization_id' is set if @api_client.config.client_side_validation && localization_id.nil? fail ArgumentError, "Missing the required parameter 'localization_id' when calling LocalizationsApi.get_draft_localization_by_id" end # verify the required parameter 'target_language' is set if @api_client.config.client_side_validation && target_language.nil? fail ArgumentError, "Missing the required parameter 'target_language' when calling LocalizationsApi.get_draft_localization_by_id" end # verify enum value allowable_values = ["html", "handlebars", "ampscript", "freemarker", "cheetah", "jinja", "liquid"] if @api_client.config.client_side_validation && !allowable_values.include?(target_language) fail ArgumentError, "invalid value for \"target_language\", must be one of #{allowable_values}" end # verify the required parameter 'accept' is set if @api_client.config.client_side_validation && accept.nil? fail ArgumentError, "Missing the required parameter 'accept' when calling LocalizationsApi.get_draft_localization_by_id" end # resource path local_var_path = '/localizations/{localizationId}/drafts/{draftId}'.sub('{' + 'draftId' + '}', CGI.escape(draft_id.to_s)).sub('{' + 'localizationId' + '}', CGI.escape(localization_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'targetLanguage'] = target_language # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2020.11+json', '*/*']) header_params[:'Accept'] = accept # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'LocalizationRead' # auth_names auth_names = opts[:auth_names] || ['Bearer'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: LocalizationsApi#get_draft_localization_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_published_localization_by_id(localization_id, target_language, accept, opts = {}) ⇒ LocalizationRead
Get Localization Object by ID Returns the published content associated with the localization of the matching ID
116 117 118 119 |
# File 'lib/dyspatch_client/api/localizations_api.rb', line 116 def get_published_localization_by_id(localization_id, target_language, accept, opts = {}) data, _status_code, _headers = get_published_localization_by_id_with_http_info(localization_id, target_language, accept, opts) data end |
#get_published_localization_by_id_with_http_info(localization_id, target_language, accept, opts = {}) ⇒ Array<(LocalizationRead, Integer, Hash)>
Get Localization Object by ID Returns the published content associated with the localization of the matching ID
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 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/dyspatch_client/api/localizations_api.rb', line 128 def get_published_localization_by_id_with_http_info(localization_id, target_language, accept, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LocalizationsApi.get_published_localization_by_id ...' end # verify the required parameter 'localization_id' is set if @api_client.config.client_side_validation && localization_id.nil? fail ArgumentError, "Missing the required parameter 'localization_id' when calling LocalizationsApi.get_published_localization_by_id" end # verify the required parameter 'target_language' is set if @api_client.config.client_side_validation && target_language.nil? fail ArgumentError, "Missing the required parameter 'target_language' when calling LocalizationsApi.get_published_localization_by_id" end # verify enum value allowable_values = ["html", "handlebars", "ampscript", "freemarker", "cheetah", "jinja", "liquid"] if @api_client.config.client_side_validation && !allowable_values.include?(target_language) fail ArgumentError, "invalid value for \"target_language\", must be one of #{allowable_values}" end # verify the required parameter 'accept' is set if @api_client.config.client_side_validation && accept.nil? fail ArgumentError, "Missing the required parameter 'accept' when calling LocalizationsApi.get_published_localization_by_id" end # resource path local_var_path = '/localizations/{localizationId}'.sub('{' + 'localizationId' + '}', CGI.escape(localization_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'targetLanguage'] = target_language # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.dyspatch.2020.11+json', '*/*']) header_params[:'Accept'] = accept # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'LocalizationRead' # auth_names auth_names = opts[:auth_names] || ['Bearer'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: LocalizationsApi#get_published_localization_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |