Class: PureCloud::ArchitectApi

Inherits:
Object
  • Object
show all
Defined in:
lib/purecloud/api/architect_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ArchitectApi

Returns a new instance of ArchitectApi.

[View source]

7
8
9
# File 'lib/purecloud/api/architect_api.rb', line 7

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.


5
6
7
# File 'lib/purecloud/api/architect_api.rb', line 5

def api_client
  @api_client
end

Instance Method Details

#delete_flows(id, opts = {}) ⇒ nil

Batch-delete a list of flows Multiple IDs can be specified, in which case all specified flows will be deleted.

Parameters:

  • id

    List of Flow IDs

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

    the optional parameters

Options Hash (opts):

  • :ignore_dependencies (BOOLEAN)

    Ignore Dependencies

Returns:

  • (nil)
[View source]

170
171
172
173
# File 'lib/purecloud/api/architect_api.rb', line 170

def delete_flows(id, opts = {})
  delete_flows_with_http_info(id, opts)
  return nil
end

#delete_flows_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Batch-delete a list of flows Multiple IDs can be specified, in which case all specified flows will be deleted.

Parameters:

  • id

    List of Flow IDs

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

    the optional parameters

Options Hash (opts):

  • :ignore_dependencies (BOOLEAN)

    Ignore Dependencies

Returns:

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

    nil, response status code and response headers

[View source]

181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/purecloud/api/architect_api.rb', line 181

def delete_flows_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ArchitectApi#delete_flows ..."
  end
  
  # verify the required parameter 'id' is set
  fail "Missing the required parameter 'id' when calling delete_flows" if id.nil?
  
  # resource path
  path = "/api/v1/flows".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'id'] = @api_client.build_collection_param(id, :multi)
  query_params[:'ignoreDependencies'] = opts[:'ignore_dependencies'] if opts[:'ignore_dependencies']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:DELETE, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ArchitectApi#delete_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_flows(opts = {}) ⇒ FlowEntityListing

Get a pageable list of flows, filtered by query parameters Multiple IDs can be specified, in which case all matching flows will be returned, and no other parameters will be evaluated.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :type (String)

    Type

  • :page_number (Integer)

    Page number

  • :page_size (Integer)

    Page size

  • :sort_by (String)

    Sort by

  • :sort_order (String)

    Sort order

  • :id (Array<String>)

    ID

  • :name (String)

    Name

  • :description (String)

    Description

  • :name_or_description (String)

    Name or description

  • :publish_version_id (String)

    Publish version ID

  • :editable_by (String)

    Editable by

  • :locked_by (String)

    Locked by

  • :deleted (BOOLEAN)

    Include deleted

Returns:

[View source]

28
29
30
31
# File 'lib/purecloud/api/architect_api.rb', line 28

def get_flows(opts = {})
  data, status_code, headers = get_flows_with_http_info(opts)
  return data
end

#get_flows_with_http_info(opts = {}) ⇒ Array<(FlowEntityListing, Fixnum, Hash)>

Get a pageable list of flows, filtered by query parameters Multiple IDs can be specified, in which case all matching flows will be returned, and no other parameters will be evaluated.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :type (String)

    Type

  • :page_number (Integer)

    Page number

  • :page_size (Integer)

    Page size

  • :sort_by (String)

    Sort by

  • :sort_order (String)

    Sort order

  • :id (Array<String>)

    ID

  • :name (String)

    Name

  • :description (String)

    Description

  • :name_or_description (String)

    Name or description

  • :publish_version_id (String)

    Publish version ID

  • :editable_by (String)

    Editable by

  • :locked_by (String)

    Locked by

  • :deleted (BOOLEAN)

    Include deleted

Returns:

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

    FlowEntityListing data, response status code and response headers

[View source]

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
# File 'lib/purecloud/api/architect_api.rb', line 50

def get_flows_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ArchitectApi#get_flows ..."
  end
  
  # resource path
  path = "/api/v1/flows".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if opts[:'type']
  query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']
  query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']
  query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']
  query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']
  query_params[:'name'] = opts[:'name'] if opts[:'name']
  query_params[:'description'] = opts[:'description'] if opts[:'description']
  query_params[:'nameOrDescription'] = opts[:'name_or_description'] if opts[:'name_or_description']
  query_params[:'publishVersionId'] = opts[:'publish_version_id'] if opts[:'publish_version_id']
  query_params[:'editableBy'] = opts[:'editable_by'] if opts[:'editable_by']
  query_params[:'lockedBy'] = opts[:'locked_by'] if opts[:'locked_by']
  query_params[:'deleted'] = opts[:'deleted'] if opts[:'deleted']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'FlowEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ArchitectApi#get_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_flows(opts = {}) ⇒ Flow

Create flow

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

[View source]

111
112
113
114
# File 'lib/purecloud/api/architect_api.rb', line 111

def post_flows(opts = {})
  data, status_code, headers = post_flows_with_http_info(opts)
  return data
end

#post_flows_with_http_info(opts = {}) ⇒ Array<(Flow, Fixnum, Hash)>

Create flow

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Flow data, response status code and response headers

[View source]

121
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
# File 'lib/purecloud/api/architect_api.rb', line 121

def post_flows_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ArchitectApi#post_flows ..."
  end
  
  # resource path
  path = "/api/v1/flows".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  

  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:POST, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Flow')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ArchitectApi#post_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end