oci 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/oci.rb +1 -0
- data/lib/oci/api_client.rb +22 -4
- data/lib/oci/audit/audit_client.rb +7 -7
- data/lib/oci/core/blockstorage_client.rb +30 -30
- data/lib/oci/core/compute_client.rb +55 -54
- data/lib/oci/core/core.rb +2 -0
- data/lib/oci/core/models/attach_paravirtualized_volume_details.rb +133 -0
- data/lib/oci/core/models/attach_volume_details.rb +2 -1
- data/lib/oci/core/models/create_image_details.rb +1 -1
- data/lib/oci/core/models/create_public_ip_details.rb +1 -1
- data/lib/oci/core/models/create_virtual_circuit_details.rb +1 -1
- data/lib/oci/core/models/create_volume_backup_details.rb +1 -1
- data/lib/oci/core/models/image.rb +22 -1
- data/lib/oci/core/models/image_source_details.rb +1 -1
- data/lib/oci/core/models/instance_source_via_image_details.rb +20 -1
- data/lib/oci/core/models/paravirtualized_volume_attachment.rb +154 -0
- data/lib/oci/core/models/update_virtual_circuit_details.rb +1 -1
- data/lib/oci/core/models/volume_attachment.rb +1 -0
- data/lib/oci/core/virtual_network_client.rb +154 -154
- data/lib/oci/database/database_client.rb +59 -59
- data/lib/oci/database/models/create_data_guard_association_details.rb +2 -2
- data/lib/oci/database/models/create_database_details.rb +1 -1
- data/lib/oci/database/models/create_db_home_with_db_system_id_base.rb +1 -1
- data/lib/oci/database/models/launch_db_system_details.rb +3 -3
- data/lib/oci/database/models/patch_details.rb +1 -1
- data/lib/oci/dns/dns_client.rb +44 -44
- data/lib/oci/dns/models/create_zone_details.rb +1 -1
- data/lib/oci/dns/models/record_operation.rb +1 -1
- data/lib/oci/email/email.rb +22 -0
- data/lib/oci/email/email_client.rb +417 -0
- data/lib/oci/email/models/create_sender_details.rb +147 -0
- data/lib/oci/email/models/create_suppression_details.rb +149 -0
- data/lib/oci/email/models/sender.rb +219 -0
- data/lib/oci/email/models/sender_summary.rb +195 -0
- data/lib/oci/email/models/suppression.rb +191 -0
- data/lib/oci/email/models/suppression_summary.rb +192 -0
- data/lib/oci/email/util.rb +2 -0
- data/lib/oci/file_storage/file_storage_client.rb +42 -42
- data/lib/oci/identity/identity.rb +4 -0
- data/lib/oci/identity/identity_client.rb +250 -94
- data/lib/oci/identity/models/compartment.rb +1 -1
- data/lib/oci/identity/models/create_compartment_details.rb +1 -1
- data/lib/oci/identity/models/create_identity_provider_details.rb +2 -2
- data/lib/oci/identity/models/create_smtp_credential_details.rb +122 -0
- data/lib/oci/identity/models/smtp_credential.rb +285 -0
- data/lib/oci/identity/models/smtp_credential_summary.rb +267 -0
- data/lib/oci/identity/models/update_compartment_details.rb +1 -0
- data/lib/oci/identity/models/update_identity_provider_details.rb +1 -1
- data/lib/oci/identity/models/update_smtp_credential_details.rb +121 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +74 -74
- data/lib/oci/object_storage/models/create_bucket_details.rb +2 -2
- data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +1 -1
- data/lib/oci/object_storage/models/update_bucket_details.rb +1 -1
- data/lib/oci/object_storage/object_storage_client.rb +73 -73
- data/lib/oci/regions.rb +2 -1
- data/lib/oci/response.rb +1 -0
- data/lib/oci/version.rb +1 -1
- metadata +17 -20
@@ -80,7 +80,7 @@ module OCI
|
|
80
80
|
# @param [Object] zone_type Object to be assigned
|
81
81
|
def zone_type=(zone_type)
|
82
82
|
if zone_type && !ZONE_TYPE_ENUM.include?(zone_type)
|
83
|
-
|
83
|
+
raise "Invalid value for 'zone_type': this must be one of the values in ZONE_TYPE_ENUM."
|
84
84
|
else
|
85
85
|
@zone_type = zone_type
|
86
86
|
end
|
@@ -147,7 +147,7 @@ module OCI
|
|
147
147
|
# @param [Object] operation Object to be assigned
|
148
148
|
def operation=(operation)
|
149
149
|
if operation && !OPERATION_ENUM.include?(operation)
|
150
|
-
|
150
|
+
raise "Invalid value for 'operation': this must be one of the values in OPERATION_ENUM."
|
151
151
|
else
|
152
152
|
@operation = operation
|
153
153
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
module OCI
|
4
|
+
module Email
|
5
|
+
module Models
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
# Require models
|
11
|
+
require 'oci/email/models/create_sender_details'
|
12
|
+
require 'oci/email/models/create_suppression_details'
|
13
|
+
require 'oci/email/models/sender'
|
14
|
+
require 'oci/email/models/sender_summary'
|
15
|
+
require 'oci/email/models/suppression'
|
16
|
+
require 'oci/email/models/suppression_summary'
|
17
|
+
|
18
|
+
# Require generated clients
|
19
|
+
require 'oci/email/email_client'
|
20
|
+
|
21
|
+
# Require service utilities
|
22
|
+
require 'oci/email/util'
|
@@ -0,0 +1,417 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require "uri"
|
4
|
+
require "logger"
|
5
|
+
|
6
|
+
module OCI
|
7
|
+
|
8
|
+
class Email::EmailClient
|
9
|
+
|
10
|
+
# Client used to make HTTP requests.
|
11
|
+
# @return [OCI::ApiClient]
|
12
|
+
attr_reader :api_client
|
13
|
+
|
14
|
+
# Fully qualified endpoint URL
|
15
|
+
# @return [String]
|
16
|
+
attr_reader :endpoint
|
17
|
+
|
18
|
+
# The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
|
19
|
+
# @return [String]
|
20
|
+
attr_accessor :region
|
21
|
+
|
22
|
+
# Creates a new EmailClient.
|
23
|
+
# If a config is not specified, then the global OCI.config will be used.
|
24
|
+
#
|
25
|
+
# A region must be specified in either the config or the region parameter. If specified
|
26
|
+
# in both, then the region parameter will be used.
|
27
|
+
#
|
28
|
+
# @param [Config] config A Config object.
|
29
|
+
# @param [String] region A region used to determine the service endpoint. This will usually
|
30
|
+
# correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
|
31
|
+
# @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
|
32
|
+
# a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
|
33
|
+
# so that the instance principals signer can be provided to the client
|
34
|
+
def initialize(config:nil, region:nil, signer:nil)
|
35
|
+
# If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
|
36
|
+
# then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
|
37
|
+
# and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
|
38
|
+
# pass it to this constructor.
|
39
|
+
#
|
40
|
+
# If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
|
41
|
+
# so try and load the config from the default file.
|
42
|
+
config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
|
43
|
+
config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
|
44
|
+
config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
|
45
|
+
|
46
|
+
if signer.nil?
|
47
|
+
signer = Signer.new(config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content, signing_strategy: Signer::STANDARD)
|
48
|
+
end
|
49
|
+
|
50
|
+
@api_client = ApiClient.new(config, signer)
|
51
|
+
|
52
|
+
region ||= config.region
|
53
|
+
region ||= signer.region if signer.respond_to?(:region)
|
54
|
+
self.region = region
|
55
|
+
end
|
56
|
+
|
57
|
+
# Set the region that will be used to determine the service endpoint.
|
58
|
+
# This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
|
59
|
+
# but may be an arbitrary string.
|
60
|
+
def region=(r)
|
61
|
+
@region = r
|
62
|
+
|
63
|
+
raise 'A region must be specified.' unless @region
|
64
|
+
|
65
|
+
@endpoint = OCI::Regions.get_service_endpoint(@region, :EmailClient) + '/20170907'
|
66
|
+
logger.info "EmailClient endpoint set to '#{endpoint}'." if logger
|
67
|
+
end
|
68
|
+
|
69
|
+
# @return [Logger] The logger for this client. May be nil.
|
70
|
+
def logger
|
71
|
+
@api_client.config.logger
|
72
|
+
end
|
73
|
+
|
74
|
+
|
75
|
+
# Creates a sender for a tenancy in a given compartment.
|
76
|
+
# @param [CreateSenderDetails] create_sender_details Create a sender.
|
77
|
+
# @param [Hash] opts the optional parameters
|
78
|
+
# @return [Response] A Response object with data of type OCI::Email::Models::Sender
|
79
|
+
def create_sender(create_sender_details, opts = {})
|
80
|
+
logger.debug "Calling operation EmailClient#create_sender." if logger
|
81
|
+
|
82
|
+
raise "Missing the required parameter 'create_sender_details' when calling create_sender." if create_sender_details.nil?
|
83
|
+
|
84
|
+
path = "/senders"
|
85
|
+
|
86
|
+
# Query Params
|
87
|
+
query_params = {}
|
88
|
+
|
89
|
+
# Header Params
|
90
|
+
header_params = {}
|
91
|
+
header_params['accept'] = 'application/json'
|
92
|
+
header_params['content-type'] = 'application/json'
|
93
|
+
|
94
|
+
post_body = @api_client.object_to_http_body(create_sender_details)
|
95
|
+
|
96
|
+
return @api_client.call_api(
|
97
|
+
:POST,
|
98
|
+
path,
|
99
|
+
endpoint,
|
100
|
+
:header_params => header_params,
|
101
|
+
:query_params => query_params,
|
102
|
+
:body => post_body,
|
103
|
+
:return_type => 'OCI::Email::Models::Sender')
|
104
|
+
end
|
105
|
+
|
106
|
+
# Adds recipient email addresses to the suppression list for a tenancy.
|
107
|
+
#
|
108
|
+
# @param [CreateSuppressionDetails] create_suppression_details Adds a single email address to the suppression list for a compartment's tenancy.
|
109
|
+
#
|
110
|
+
# @param [Hash] opts the optional parameters
|
111
|
+
# @return [Response] A Response object with data of type OCI::Email::Models::Suppression
|
112
|
+
def create_suppression(create_suppression_details, opts = {})
|
113
|
+
logger.debug "Calling operation EmailClient#create_suppression." if logger
|
114
|
+
|
115
|
+
raise "Missing the required parameter 'create_suppression_details' when calling create_suppression." if create_suppression_details.nil?
|
116
|
+
|
117
|
+
path = "/suppressions"
|
118
|
+
|
119
|
+
# Query Params
|
120
|
+
query_params = {}
|
121
|
+
|
122
|
+
# Header Params
|
123
|
+
header_params = {}
|
124
|
+
header_params['accept'] = 'application/json'
|
125
|
+
header_params['content-type'] = 'application/json'
|
126
|
+
|
127
|
+
post_body = @api_client.object_to_http_body(create_suppression_details)
|
128
|
+
|
129
|
+
return @api_client.call_api(
|
130
|
+
:POST,
|
131
|
+
path,
|
132
|
+
endpoint,
|
133
|
+
:header_params => header_params,
|
134
|
+
:query_params => query_params,
|
135
|
+
:body => post_body,
|
136
|
+
:return_type => 'OCI::Email::Models::Suppression')
|
137
|
+
end
|
138
|
+
|
139
|
+
# Deletes an approved sender for a tenancy in a given compartment for a
|
140
|
+
# provided `senderId`.
|
141
|
+
#
|
142
|
+
# @param [String] sender_id The unique OCID of the sender.
|
143
|
+
# @param [Hash] opts the optional parameters
|
144
|
+
# @return [Response] A Response object with data of type nil
|
145
|
+
def delete_sender(sender_id, opts = {})
|
146
|
+
logger.debug "Calling operation EmailClient#delete_sender." if logger
|
147
|
+
|
148
|
+
raise "Missing the required parameter 'sender_id' when calling delete_sender." if sender_id.nil?
|
149
|
+
|
150
|
+
path = "/senders/{senderId}".sub('{senderId}', sender_id.to_s)
|
151
|
+
|
152
|
+
# Query Params
|
153
|
+
query_params = {}
|
154
|
+
|
155
|
+
# Header Params
|
156
|
+
header_params = {}
|
157
|
+
header_params['accept'] = 'application/json'
|
158
|
+
header_params['content-type'] = 'application/json'
|
159
|
+
|
160
|
+
post_body = nil
|
161
|
+
|
162
|
+
return @api_client.call_api(
|
163
|
+
:DELETE,
|
164
|
+
path,
|
165
|
+
endpoint,
|
166
|
+
:header_params => header_params,
|
167
|
+
:query_params => query_params,
|
168
|
+
:body => post_body)
|
169
|
+
end
|
170
|
+
|
171
|
+
# Removes a suppressed recipient email address from the suppression list
|
172
|
+
# for a tenancy in a given compartment for a provided `suppressionId`.
|
173
|
+
#
|
174
|
+
# @param [String] suppression_id The unique OCID of the suppression.
|
175
|
+
# @param [Hash] opts the optional parameters
|
176
|
+
# @return [Response] A Response object with data of type nil
|
177
|
+
def delete_suppression(suppression_id, opts = {})
|
178
|
+
logger.debug "Calling operation EmailClient#delete_suppression." if logger
|
179
|
+
|
180
|
+
raise "Missing the required parameter 'suppression_id' when calling delete_suppression." if suppression_id.nil?
|
181
|
+
|
182
|
+
path = "/suppressions/{suppressionId}".sub('{suppressionId}', suppression_id.to_s)
|
183
|
+
|
184
|
+
# Query Params
|
185
|
+
query_params = {}
|
186
|
+
|
187
|
+
# Header Params
|
188
|
+
header_params = {}
|
189
|
+
header_params['accept'] = 'application/json'
|
190
|
+
header_params['content-type'] = 'application/json'
|
191
|
+
|
192
|
+
post_body = nil
|
193
|
+
|
194
|
+
return @api_client.call_api(
|
195
|
+
:DELETE,
|
196
|
+
path,
|
197
|
+
endpoint,
|
198
|
+
:header_params => header_params,
|
199
|
+
:query_params => query_params,
|
200
|
+
:body => post_body)
|
201
|
+
end
|
202
|
+
|
203
|
+
# Gets an approved sender for a given `senderId`.
|
204
|
+
# @param [String] sender_id The unique OCID of the sender.
|
205
|
+
# @param [Hash] opts the optional parameters
|
206
|
+
# @return [Response] A Response object with data of type OCI::Email::Models::Sender
|
207
|
+
def get_sender(sender_id, opts = {})
|
208
|
+
logger.debug "Calling operation EmailClient#get_sender." if logger
|
209
|
+
|
210
|
+
raise "Missing the required parameter 'sender_id' when calling get_sender." if sender_id.nil?
|
211
|
+
|
212
|
+
path = "/senders/{senderId}".sub('{senderId}', sender_id.to_s)
|
213
|
+
|
214
|
+
# Query Params
|
215
|
+
query_params = {}
|
216
|
+
|
217
|
+
# Header Params
|
218
|
+
header_params = {}
|
219
|
+
header_params['accept'] = 'application/json'
|
220
|
+
header_params['content-type'] = 'application/json'
|
221
|
+
|
222
|
+
post_body = nil
|
223
|
+
|
224
|
+
return @api_client.call_api(
|
225
|
+
:GET,
|
226
|
+
path,
|
227
|
+
endpoint,
|
228
|
+
:header_params => header_params,
|
229
|
+
:query_params => query_params,
|
230
|
+
:body => post_body,
|
231
|
+
:return_type => 'OCI::Email::Models::Sender')
|
232
|
+
end
|
233
|
+
|
234
|
+
# Gets the details of a suppressed recipient email address for a given
|
235
|
+
# `suppressionId`. Each suppression is given a unique OCID.
|
236
|
+
#
|
237
|
+
# @param [String] suppression_id The unique OCID of the suppression.
|
238
|
+
# @param [Hash] opts the optional parameters
|
239
|
+
# @return [Response] A Response object with data of type OCI::Email::Models::Suppression
|
240
|
+
def get_suppression(suppression_id, opts = {})
|
241
|
+
logger.debug "Calling operation EmailClient#get_suppression." if logger
|
242
|
+
|
243
|
+
raise "Missing the required parameter 'suppression_id' when calling get_suppression." if suppression_id.nil?
|
244
|
+
|
245
|
+
path = "/suppressions/{suppressionId}".sub('{suppressionId}', suppression_id.to_s)
|
246
|
+
|
247
|
+
# Query Params
|
248
|
+
query_params = {}
|
249
|
+
|
250
|
+
# Header Params
|
251
|
+
header_params = {}
|
252
|
+
header_params['accept'] = 'application/json'
|
253
|
+
header_params['content-type'] = 'application/json'
|
254
|
+
|
255
|
+
post_body = nil
|
256
|
+
|
257
|
+
return @api_client.call_api(
|
258
|
+
:GET,
|
259
|
+
path,
|
260
|
+
endpoint,
|
261
|
+
:header_params => header_params,
|
262
|
+
:query_params => query_params,
|
263
|
+
:body => post_body,
|
264
|
+
:return_type => 'OCI::Email::Models::Suppression')
|
265
|
+
end
|
266
|
+
|
267
|
+
# Gets a collection of approved sender email addresses and sender IDs.
|
268
|
+
#
|
269
|
+
# @param [String] compartment_id The OCID for the compartment.
|
270
|
+
# @param [Hash] opts the optional parameters
|
271
|
+
# @option opts [String] :lifecycle_state The current state of a sender.
|
272
|
+
# @option opts [String] :email_address The email address of the approved sender.
|
273
|
+
# @option opts [String] :page The value of the `opc-next-page` response header from the previous
|
274
|
+
# GET request.
|
275
|
+
#
|
276
|
+
# @option opts [Integer] :limit The maximum number of items to return in a paginated GET request.
|
277
|
+
#
|
278
|
+
# @option opts [String] :sort_by The field to sort by. The `TIMECREATED` value returns the list in in
|
279
|
+
# descending order by default. The `EMAILADDRESS` value returns the list in
|
280
|
+
# ascending order by default. Use the `SortOrderQueryParam` to change the
|
281
|
+
# direction of the returned list of items.
|
282
|
+
#
|
283
|
+
# Allowed values are: TIMECREATED, EMAILADDRESS
|
284
|
+
# @option opts [String] :sort_order The sort order to use, either ascending or descending order.
|
285
|
+
#
|
286
|
+
# Allowed values are: ASC, DESC
|
287
|
+
# @return [Response] A Response object with data of type Array<OCI::Email::Models::SenderSummary>
|
288
|
+
def list_senders(compartment_id, opts = {})
|
289
|
+
logger.debug "Calling operation EmailClient#list_senders." if logger
|
290
|
+
|
291
|
+
raise "Missing the required parameter 'compartment_id' when calling list_senders." if compartment_id.nil?
|
292
|
+
|
293
|
+
if opts[:'lifecycle_state'] && !OCI::Email::Models::Sender::LIFECYCLE_STATE_ENUM.include?(opts[:'lifecycle_state'])
|
294
|
+
raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Email::Models::Sender::LIFECYCLE_STATE_ENUM.'
|
295
|
+
end
|
296
|
+
|
297
|
+
if opts[:'sort_by'] && !['TIMECREATED', 'EMAILADDRESS'].include?(opts[:'sort_by'])
|
298
|
+
raise 'Invalid value for "sort_by", must be one of TIMECREATED, EMAILADDRESS.'
|
299
|
+
end
|
300
|
+
|
301
|
+
if opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order'])
|
302
|
+
raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
|
303
|
+
end
|
304
|
+
|
305
|
+
path = "/senders"
|
306
|
+
|
307
|
+
# Query Params
|
308
|
+
query_params = {}
|
309
|
+
query_params[:'compartmentId'] = compartment_id
|
310
|
+
query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state']
|
311
|
+
query_params[:'emailAddress'] = opts[:'email_address'] if opts[:'email_address']
|
312
|
+
query_params[:'page'] = opts[:'page'] if opts[:'page']
|
313
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
314
|
+
query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']
|
315
|
+
query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
|
316
|
+
|
317
|
+
# Header Params
|
318
|
+
header_params = {}
|
319
|
+
header_params['accept'] = 'application/json'
|
320
|
+
header_params['content-type'] = 'application/json'
|
321
|
+
|
322
|
+
post_body = nil
|
323
|
+
|
324
|
+
return @api_client.call_api(
|
325
|
+
:GET,
|
326
|
+
path,
|
327
|
+
endpoint,
|
328
|
+
:header_params => header_params,
|
329
|
+
:query_params => query_params,
|
330
|
+
:body => post_body,
|
331
|
+
:return_type => 'Array<OCI::Email::Models::SenderSummary>')
|
332
|
+
end
|
333
|
+
|
334
|
+
# Gets a list of suppressed recipient email addresses for a user. The
|
335
|
+
# `compartmentId` for suppressions must be a tenancy OCID. The returned list
|
336
|
+
# is sorted by creation time in descending order.
|
337
|
+
#
|
338
|
+
# @param [String] compartment_id The OCID for the compartment.
|
339
|
+
# @param [Hash] opts the optional parameters
|
340
|
+
# @option opts [String] :email_address The email address of the suppression.
|
341
|
+
# @option opts [DateTime] :time_created_greater_than_or_equal_to Search for suppressions that were created within a specific date range,
|
342
|
+
# using this parameter to specify the earliest creation date for the
|
343
|
+
# returned list (inclusive). Specifying this parameter without the
|
344
|
+
# corresponding `timeCreatedLessThan` parameter will retrieve suppressions created from the
|
345
|
+
# given `timeCreatedGreaterThanOrEqualTo` to the current time, in \"YYYY-MM-ddThh:mmZ\" format with a
|
346
|
+
# Z offset, as defined by RFC 3339.
|
347
|
+
#
|
348
|
+
# **Example:** 2016-12-19T16:39:57.600Z
|
349
|
+
#
|
350
|
+
# @option opts [DateTime] :time_created_less_than Search for suppressions that were created within a specific date range,
|
351
|
+
# using this parameter to specify the latest creation date for the returned
|
352
|
+
# list (exclusive). Specifying this parameter without the corresponding
|
353
|
+
# `timeCreatedGreaterThanOrEqualTo` parameter will retrieve all suppressions created before the
|
354
|
+
# specified end date, in \"YYYY-MM-ddThh:mmZ\" format with a Z offset, as
|
355
|
+
# defined by RFC 3339.
|
356
|
+
#
|
357
|
+
# **Example:** 2016-12-19T16:39:57.600Z
|
358
|
+
#
|
359
|
+
# @option opts [String] :page The value of the `opc-next-page` response header from the previous
|
360
|
+
# GET request.
|
361
|
+
#
|
362
|
+
# @option opts [Integer] :limit The maximum number of items to return in a paginated GET request.
|
363
|
+
#
|
364
|
+
# @option opts [String] :sort_by The field to sort by. The `TIMECREATED` value returns the list in in
|
365
|
+
# descending order by default. The `EMAILADDRESS` value returns the list in
|
366
|
+
# ascending order by default. Use the `SortOrderQueryParam` to change the
|
367
|
+
# direction of the returned list of items.
|
368
|
+
#
|
369
|
+
# Allowed values are: TIMECREATED, EMAILADDRESS
|
370
|
+
# @option opts [String] :sort_order The sort order to use, either ascending or descending order.
|
371
|
+
#
|
372
|
+
# Allowed values are: ASC, DESC
|
373
|
+
# @return [Response] A Response object with data of type Array<OCI::Email::Models::SuppressionSummary>
|
374
|
+
def list_suppressions(compartment_id, opts = {})
|
375
|
+
logger.debug "Calling operation EmailClient#list_suppressions." if logger
|
376
|
+
|
377
|
+
raise "Missing the required parameter 'compartment_id' when calling list_suppressions." if compartment_id.nil?
|
378
|
+
|
379
|
+
if opts[:'sort_by'] && !['TIMECREATED', 'EMAILADDRESS'].include?(opts[:'sort_by'])
|
380
|
+
raise 'Invalid value for "sort_by", must be one of TIMECREATED, EMAILADDRESS.'
|
381
|
+
end
|
382
|
+
|
383
|
+
if opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order'])
|
384
|
+
raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
|
385
|
+
end
|
386
|
+
|
387
|
+
path = "/suppressions"
|
388
|
+
|
389
|
+
# Query Params
|
390
|
+
query_params = {}
|
391
|
+
query_params[:'compartmentId'] = compartment_id
|
392
|
+
query_params[:'emailAddress'] = opts[:'email_address'] if opts[:'email_address']
|
393
|
+
query_params[:'timeCreatedGreaterThanOrEqualTo'] = opts[:'time_created_greater_than_or_equal_to'] if opts[:'time_created_greater_than_or_equal_to']
|
394
|
+
query_params[:'timeCreatedLessThan'] = opts[:'time_created_less_than'] if opts[:'time_created_less_than']
|
395
|
+
query_params[:'page'] = opts[:'page'] if opts[:'page']
|
396
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
397
|
+
query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by']
|
398
|
+
query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']
|
399
|
+
|
400
|
+
# Header Params
|
401
|
+
header_params = {}
|
402
|
+
header_params['accept'] = 'application/json'
|
403
|
+
header_params['content-type'] = 'application/json'
|
404
|
+
|
405
|
+
post_body = nil
|
406
|
+
|
407
|
+
return @api_client.call_api(
|
408
|
+
:GET,
|
409
|
+
path,
|
410
|
+
endpoint,
|
411
|
+
:header_params => header_params,
|
412
|
+
:query_params => query_params,
|
413
|
+
:body => post_body,
|
414
|
+
:return_type => 'Array<OCI::Email::Models::SuppressionSummary>')
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|