|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | +DataExtensionsApi.py |
| 5 | +Copyright 2016 SmartBear Software |
| 6 | +
|
| 7 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + you may not use this file except in compliance with the License. |
| 9 | + You may obtain a copy of the License at |
| 10 | +
|
| 11 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +
|
| 13 | + Unless required by applicable law or agreed to in writing, software |
| 14 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + See the License for the specific language governing permissions and |
| 17 | + limitations under the License. |
| 18 | +""" |
| 19 | + |
| 20 | +from __future__ import absolute_import |
| 21 | + |
| 22 | +import sys |
| 23 | +import os |
| 24 | +import re |
| 25 | + |
| 26 | +# python 2 and python 3 compatibility library |
| 27 | +from six import iteritems |
| 28 | + |
| 29 | +from ..configuration import Configuration |
| 30 | +from ..api_client import ApiClient |
| 31 | + |
| 32 | + |
| 33 | +class DataExtensionsApi(object): |
| 34 | + """ |
| 35 | + NOTE: This class is auto generated by the swagger code generator program. |
| 36 | + Do not edit the class manually. |
| 37 | + Ref: https://github.com/swagger-api/swagger-codegen |
| 38 | + """ |
| 39 | + |
| 40 | + def __init__(self, api_client=None): |
| 41 | + config = Configuration() |
| 42 | + if api_client: |
| 43 | + self.api_client = api_client |
| 44 | + else: |
| 45 | + if not config.api_client: |
| 46 | + config.api_client = ApiClient() |
| 47 | + self.api_client = config.api_client |
| 48 | + |
| 49 | + def get_dataextensions_coretype(self, coretype_name, **kwargs): |
| 50 | + """ |
| 51 | + Get a specific named core type. |
| 52 | + |
| 53 | +
|
| 54 | + This method makes a synchronous HTTP request by default. To make an |
| 55 | + asynchronous HTTP request, please define a `callback` function |
| 56 | + to be invoked when receiving the response. |
| 57 | + >>> def callback_function(response): |
| 58 | + >>> pprint(response) |
| 59 | + >>> |
| 60 | + >>> thread = api.get_dataextensions_coretype(coretype_name, callback=callback_function) |
| 61 | +
|
| 62 | + :param callback function: The callback function |
| 63 | + for asynchronous request. (optional) |
| 64 | + :param str coretype_name: The core type's name (required) |
| 65 | + :return: Coretype |
| 66 | + If the method is called asynchronously, |
| 67 | + returns the request thread. |
| 68 | + """ |
| 69 | + |
| 70 | + all_params = ['coretype_name'] |
| 71 | + all_params.append('callback') |
| 72 | + |
| 73 | + params = locals() |
| 74 | + for key, val in iteritems(params['kwargs']): |
| 75 | + if key not in all_params: |
| 76 | + raise TypeError( |
| 77 | + "Got an unexpected keyword argument '%s'" |
| 78 | + " to method get_dataextensions_coretype" % key |
| 79 | + ) |
| 80 | + params[key] = val |
| 81 | + del params['kwargs'] |
| 82 | + |
| 83 | + # verify the required parameter 'coretype_name' is set |
| 84 | + if ('coretype_name' not in params) or (params['coretype_name'] is None): |
| 85 | + raise ValueError("Missing the required parameter `coretype_name` when calling `get_dataextensions_coretype`") |
| 86 | + |
| 87 | + |
| 88 | + resource_path = '/api/v2/dataextensions/coretypes/{coretypeName}'.replace('{format}', 'json') |
| 89 | + path_params = {} |
| 90 | + if 'coretype_name' in params: |
| 91 | + path_params['coretypeName'] = params['coretype_name'] |
| 92 | + |
| 93 | + query_params = {} |
| 94 | + |
| 95 | + header_params = {} |
| 96 | + |
| 97 | + form_params = [] |
| 98 | + local_var_files = {} |
| 99 | + |
| 100 | + body_params = None |
| 101 | + |
| 102 | + # HTTP header `Accept` |
| 103 | + header_params['Accept'] = self.api_client.\ |
| 104 | + select_header_accept(['application/json']) |
| 105 | + if not header_params['Accept']: |
| 106 | + del header_params['Accept'] |
| 107 | + |
| 108 | + # HTTP header `Content-Type` |
| 109 | + header_params['Content-Type'] = self.api_client.\ |
| 110 | + select_header_content_type(['application/json']) |
| 111 | + |
| 112 | + # Authentication setting |
| 113 | + auth_settings = ['PureCloud OAuth'] |
| 114 | + |
| 115 | + response = self.api_client.call_api(resource_path, 'GET', |
| 116 | + path_params, |
| 117 | + query_params, |
| 118 | + header_params, |
| 119 | + body=body_params, |
| 120 | + post_params=form_params, |
| 121 | + files=local_var_files, |
| 122 | + response_type='Coretype', |
| 123 | + auth_settings=auth_settings, |
| 124 | + callback=params.get('callback')) |
| 125 | + return response |
| 126 | + |
| 127 | + def get_dataextensions_coretypes(self, **kwargs): |
| 128 | + """ |
| 129 | + Get the core types from which all schemas are built. |
| 130 | + |
| 131 | +
|
| 132 | + This method makes a synchronous HTTP request by default. To make an |
| 133 | + asynchronous HTTP request, please define a `callback` function |
| 134 | + to be invoked when receiving the response. |
| 135 | + >>> def callback_function(response): |
| 136 | + >>> pprint(response) |
| 137 | + >>> |
| 138 | + >>> thread = api.get_dataextensions_coretypes(callback=callback_function) |
| 139 | +
|
| 140 | + :param callback function: The callback function |
| 141 | + for asynchronous request. (optional) |
| 142 | + :return: CoretypeListing |
| 143 | + If the method is called asynchronously, |
| 144 | + returns the request thread. |
| 145 | + """ |
| 146 | + |
| 147 | + all_params = [] |
| 148 | + all_params.append('callback') |
| 149 | + |
| 150 | + params = locals() |
| 151 | + for key, val in iteritems(params['kwargs']): |
| 152 | + if key not in all_params: |
| 153 | + raise TypeError( |
| 154 | + "Got an unexpected keyword argument '%s'" |
| 155 | + " to method get_dataextensions_coretypes" % key |
| 156 | + ) |
| 157 | + params[key] = val |
| 158 | + del params['kwargs'] |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | + resource_path = '/api/v2/dataextensions/coretypes'.replace('{format}', 'json') |
| 163 | + path_params = {} |
| 164 | + |
| 165 | + query_params = {} |
| 166 | + |
| 167 | + header_params = {} |
| 168 | + |
| 169 | + form_params = [] |
| 170 | + local_var_files = {} |
| 171 | + |
| 172 | + body_params = None |
| 173 | + |
| 174 | + # HTTP header `Accept` |
| 175 | + header_params['Accept'] = self.api_client.\ |
| 176 | + select_header_accept(['application/json']) |
| 177 | + if not header_params['Accept']: |
| 178 | + del header_params['Accept'] |
| 179 | + |
| 180 | + # HTTP header `Content-Type` |
| 181 | + header_params['Content-Type'] = self.api_client.\ |
| 182 | + select_header_content_type(['application/json']) |
| 183 | + |
| 184 | + # Authentication setting |
| 185 | + auth_settings = ['PureCloud OAuth'] |
| 186 | + |
| 187 | + response = self.api_client.call_api(resource_path, 'GET', |
| 188 | + path_params, |
| 189 | + query_params, |
| 190 | + header_params, |
| 191 | + body=body_params, |
| 192 | + post_params=form_params, |
| 193 | + files=local_var_files, |
| 194 | + response_type='CoretypeListing', |
| 195 | + auth_settings=auth_settings, |
| 196 | + callback=params.get('callback')) |
| 197 | + return response |
| 198 | + |
| 199 | + def get_dataextensions_limits(self, **kwargs): |
| 200 | + """ |
| 201 | + Get quantitative limits on schemas |
| 202 | + |
| 203 | +
|
| 204 | + This method makes a synchronous HTTP request by default. To make an |
| 205 | + asynchronous HTTP request, please define a `callback` function |
| 206 | + to be invoked when receiving the response. |
| 207 | + >>> def callback_function(response): |
| 208 | + >>> pprint(response) |
| 209 | + >>> |
| 210 | + >>> thread = api.get_dataextensions_limits(callback=callback_function) |
| 211 | +
|
| 212 | + :param callback function: The callback function |
| 213 | + for asynchronous request. (optional) |
| 214 | + :return: SchemaQuantityLimits |
| 215 | + If the method is called asynchronously, |
| 216 | + returns the request thread. |
| 217 | + """ |
| 218 | + |
| 219 | + all_params = [] |
| 220 | + all_params.append('callback') |
| 221 | + |
| 222 | + params = locals() |
| 223 | + for key, val in iteritems(params['kwargs']): |
| 224 | + if key not in all_params: |
| 225 | + raise TypeError( |
| 226 | + "Got an unexpected keyword argument '%s'" |
| 227 | + " to method get_dataextensions_limits" % key |
| 228 | + ) |
| 229 | + params[key] = val |
| 230 | + del params['kwargs'] |
| 231 | + |
| 232 | + |
| 233 | + |
| 234 | + resource_path = '/api/v2/dataextensions/limits'.replace('{format}', 'json') |
| 235 | + path_params = {} |
| 236 | + |
| 237 | + query_params = {} |
| 238 | + |
| 239 | + header_params = {} |
| 240 | + |
| 241 | + form_params = [] |
| 242 | + local_var_files = {} |
| 243 | + |
| 244 | + body_params = None |
| 245 | + |
| 246 | + # HTTP header `Accept` |
| 247 | + header_params['Accept'] = self.api_client.\ |
| 248 | + select_header_accept(['application/json']) |
| 249 | + if not header_params['Accept']: |
| 250 | + del header_params['Accept'] |
| 251 | + |
| 252 | + # HTTP header `Content-Type` |
| 253 | + header_params['Content-Type'] = self.api_client.\ |
| 254 | + select_header_content_type(['application/json']) |
| 255 | + |
| 256 | + # Authentication setting |
| 257 | + auth_settings = ['PureCloud OAuth'] |
| 258 | + |
| 259 | + response = self.api_client.call_api(resource_path, 'GET', |
| 260 | + path_params, |
| 261 | + query_params, |
| 262 | + header_params, |
| 263 | + body=body_params, |
| 264 | + post_params=form_params, |
| 265 | + files=local_var_files, |
| 266 | + response_type='SchemaQuantityLimits', |
| 267 | + auth_settings=auth_settings, |
| 268 | + callback=params.get('callback')) |
| 269 | + return response |
0 commit comments