Class: Files::As2Partner
- Inherits:
-
Object
- Object
- Files::As2Partner
- Defined in:
- lib/files.com/models/as2_partner.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
- .all(params = {}, options = {}) ⇒ Object
-
.create(params = {}, options = {}) ⇒ Object
Parameters: name (required) - string - AS2 Name uri (required) - string - URL base for AS2 responses public_certificate (required) - string as2_station_id (required) - int64 - Id of As2Station for this partner server_certificate - string - Remote server certificate security setting enable_dedicated_ips - boolean.
- .delete(id, params = {}, options = {}) ⇒ Object
- .destroy(id, params = {}, options = {}) ⇒ Object
-
.find(id, params = {}, options = {}) ⇒ Object
Parameters: id (required) - int64 - As2 Partner ID.
- .get(id, params = {}, options = {}) ⇒ Object
-
.list(params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Used for pagination.
-
.update(id, params = {}, options = {}) ⇒ Object
Parameters: name - string - AS2 Name uri - string - URL base for AS2 responses server_certificate - string - Remote server certificate security setting public_certificate - string enable_dedicated_ips - boolean.
Instance Method Summary collapse
-
#as2_station_id ⇒ Object
int64 - Id of the AS2 Station associated with this partner.
- #as2_station_id=(value) ⇒ Object
- #delete(params = {}) ⇒ Object
- #destroy(params = {}) ⇒ Object
-
#enable_dedicated_ips ⇒ Object
boolean - ‘true` if remote server only accepts connections from dedicated IPs.
- #enable_dedicated_ips=(value) ⇒ Object
-
#hex_public_certificate_serial ⇒ Object
string - Serial of public certificate used for message security in hex format.
- #hex_public_certificate_serial=(value) ⇒ Object
-
#id ⇒ Object
int64 - Id of the AS2 Partner.
- #id=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ As2Partner
constructor
A new instance of As2Partner.
-
#name ⇒ Object
string - The partner’s formal AS2 name.
- #name=(value) ⇒ Object
-
#public_certificate ⇒ Object
string.
- #public_certificate=(value) ⇒ Object
-
#public_certificate_issuer ⇒ Object
string - Issuer of public certificate used for message security.
- #public_certificate_issuer=(value) ⇒ Object
-
#public_certificate_md5 ⇒ Object
string - MD5 hash of public certificate used for message security.
- #public_certificate_md5=(value) ⇒ Object
-
#public_certificate_not_after ⇒ Object
string - Not after value of public certificate used for message security.
- #public_certificate_not_after=(value) ⇒ Object
-
#public_certificate_not_before ⇒ Object
string - Not before value of public certificate used for message security.
- #public_certificate_not_before=(value) ⇒ Object
-
#public_certificate_serial ⇒ Object
string - Serial of public certificate used for message security.
- #public_certificate_serial=(value) ⇒ Object
-
#public_certificate_subject ⇒ Object
string - Subject of public certificate used for message security.
- #public_certificate_subject=(value) ⇒ Object
- #save ⇒ Object
-
#server_certificate ⇒ Object
string - Remote server certificate security setting.
- #server_certificate=(value) ⇒ Object
-
#update(params = {}) ⇒ Object
Parameters: name - string - AS2 Name uri - string - URL base for AS2 responses server_certificate - string - Remote server certificate security setting public_certificate - string enable_dedicated_ips - boolean.
-
#uri ⇒ Object
string - Public URI for sending AS2 message to.
- #uri=(value) ⇒ Object
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ As2Partner
Returns a new instance of As2Partner.
7 8 9 10 |
# File 'lib/files.com/models/as2_partner.rb', line 7 def initialize(attributes = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/as2_partner.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/as2_partner.rb', line 5 def @options end |
Class Method Details
.all(params = {}, options = {}) ⇒ Object
193 194 195 |
# File 'lib/files.com/models/as2_partner.rb', line 193 def self.all(params = {}, = {}) list(params, ) end |
.create(params = {}, options = {}) ⇒ Object
Parameters:
name (required) - string - AS2 Name
uri (required) - string - URL base for AS2 responses
public_certificate (required) - string
as2_station_id (required) - int64 - Id of As2Station for this partner
server_certificate - string - Remote server certificate security setting
enable_dedicated_ips - boolean
220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/files.com/models/as2_partner.rb', line 220 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String) raise InvalidParameterError.new("Bad parameter: uri must be an String") if params[:uri] and !params[:uri].is_a?(String) raise InvalidParameterError.new("Bad parameter: public_certificate must be an String") if params[:public_certificate] and !params[:public_certificate].is_a?(String) raise InvalidParameterError.new("Bad parameter: as2_station_id must be an Integer") if params[:as2_station_id] and !params[:as2_station_id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: server_certificate must be an String") if params[:server_certificate] and !params[:server_certificate].is_a?(String) raise MissingParameterError.new("Parameter missing: name") unless params[:name] raise MissingParameterError.new("Parameter missing: uri") unless params[:uri] raise MissingParameterError.new("Parameter missing: public_certificate") unless params[:public_certificate] raise MissingParameterError.new("Parameter missing: as2_station_id") unless params[:as2_station_id] response, = Api.send_request("/as2_partners", :post, params, ) As2Partner.new(response.data, ) end |
.delete(id, params = {}, options = {}) ⇒ Object
255 256 257 258 259 260 261 262 263 |
# File 'lib/files.com/models/as2_partner.rb', line 255 def self.delete(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/as2_partners/#{params[:id]}", :delete, params, ) response.data end |
.destroy(id, params = {}, options = {}) ⇒ Object
265 266 267 |
# File 'lib/files.com/models/as2_partner.rb', line 265 def self.destroy(id, params = {}, = {}) delete(id, params, ) end |
.find(id, params = {}, options = {}) ⇒ Object
Parameters:
id (required) - int64 - As2 Partner ID.
199 200 201 202 203 204 205 206 207 |
# File 'lib/files.com/models/as2_partner.rb', line 199 def self.find(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/as2_partners/#{params[:id]}", :get, params, ) As2Partner.new(response.data, ) end |
.get(id, params = {}, options = {}) ⇒ Object
209 210 211 |
# File 'lib/files.com/models/as2_partner.rb', line 209 def self.get(id, params = {}, = {}) find(id, params, ) end |
.list(params = {}, options = {}) ⇒ Object
Parameters:
cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
184 185 186 187 188 189 190 191 |
# File 'lib/files.com/models/as2_partner.rb', line 184 def self.list(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String) raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer) List.new(As2Partner, params) do Api.send_request("/as2_partners", :get, params, ) end end |
.update(id, params = {}, options = {}) ⇒ Object
Parameters:
name - string - AS2 Name
uri - string - URL base for AS2 responses
server_certificate - string - Remote server certificate security setting
public_certificate - string
enable_dedicated_ips - boolean
241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/files.com/models/as2_partner.rb', line 241 def self.update(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String) raise InvalidParameterError.new("Bad parameter: uri must be an String") if params[:uri] and !params[:uri].is_a?(String) raise InvalidParameterError.new("Bad parameter: server_certificate must be an String") if params[:server_certificate] and !params[:server_certificate].is_a?(String) raise InvalidParameterError.new("Bad parameter: public_certificate must be an String") if params[:public_certificate] and !params[:public_certificate].is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params[:id] response, = Api.send_request("/as2_partners/#{params[:id]}", :patch, params, ) As2Partner.new(response.data, ) end |
Instance Method Details
#as2_station_id ⇒ Object
int64 - Id of the AS2 Station associated with this partner.
22 23 24 |
# File 'lib/files.com/models/as2_partner.rb', line 22 def as2_station_id @attributes[:as2_station_id] end |
#as2_station_id=(value) ⇒ Object
26 27 28 |
# File 'lib/files.com/models/as2_partner.rb', line 26 def as2_station_id=(value) @attributes[:as2_station_id] = value end |
#delete(params = {}) ⇒ Object
158 159 160 161 162 163 164 165 166 |
# File 'lib/files.com/models/as2_partner.rb', line 158 def delete(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/as2_partners/#{@attributes[:id]}", :delete, params, @options) end |
#destroy(params = {}) ⇒ Object
168 169 170 |
# File 'lib/files.com/models/as2_partner.rb', line 168 def destroy(params = {}) delete(params) end |
#enable_dedicated_ips ⇒ Object
boolean - ‘true` if remote server only accepts connections from dedicated IPs
58 59 60 |
# File 'lib/files.com/models/as2_partner.rb', line 58 def enable_dedicated_ips @attributes[:enable_dedicated_ips] end |
#enable_dedicated_ips=(value) ⇒ Object
62 63 64 |
# File 'lib/files.com/models/as2_partner.rb', line 62 def enable_dedicated_ips=(value) @attributes[:enable_dedicated_ips] = value end |
#hex_public_certificate_serial ⇒ Object
string - Serial of public certificate used for message security in hex format.
67 68 69 |
# File 'lib/files.com/models/as2_partner.rb', line 67 def hex_public_certificate_serial @attributes[:hex_public_certificate_serial] end |
#hex_public_certificate_serial=(value) ⇒ Object
71 72 73 |
# File 'lib/files.com/models/as2_partner.rb', line 71 def hex_public_certificate_serial=(value) @attributes[:hex_public_certificate_serial] = value end |
#id ⇒ Object
int64 - Id of the AS2 Partner.
13 14 15 |
# File 'lib/files.com/models/as2_partner.rb', line 13 def id @attributes[:id] end |
#id=(value) ⇒ Object
17 18 19 |
# File 'lib/files.com/models/as2_partner.rb', line 17 def id=(value) @attributes[:id] = value end |
#name ⇒ Object
string - The partner’s formal AS2 name.
31 32 33 |
# File 'lib/files.com/models/as2_partner.rb', line 31 def name @attributes[:name] end |
#name=(value) ⇒ Object
35 36 37 |
# File 'lib/files.com/models/as2_partner.rb', line 35 def name=(value) @attributes[:name] = value end |
#public_certificate ⇒ Object
string
130 131 132 |
# File 'lib/files.com/models/as2_partner.rb', line 130 def public_certificate @attributes[:public_certificate] end |
#public_certificate=(value) ⇒ Object
134 135 136 |
# File 'lib/files.com/models/as2_partner.rb', line 134 def public_certificate=(value) @attributes[:public_certificate] = value end |
#public_certificate_issuer ⇒ Object
string - Issuer of public certificate used for message security.
94 95 96 |
# File 'lib/files.com/models/as2_partner.rb', line 94 def public_certificate_issuer @attributes[:public_certificate_issuer] end |
#public_certificate_issuer=(value) ⇒ Object
98 99 100 |
# File 'lib/files.com/models/as2_partner.rb', line 98 def public_certificate_issuer=(value) @attributes[:public_certificate_issuer] = value end |
#public_certificate_md5 ⇒ Object
string - MD5 hash of public certificate used for message security.
76 77 78 |
# File 'lib/files.com/models/as2_partner.rb', line 76 def public_certificate_md5 @attributes[:public_certificate_md5] end |
#public_certificate_md5=(value) ⇒ Object
80 81 82 |
# File 'lib/files.com/models/as2_partner.rb', line 80 def public_certificate_md5=(value) @attributes[:public_certificate_md5] = value end |
#public_certificate_not_after ⇒ Object
string - Not after value of public certificate used for message security.
121 122 123 |
# File 'lib/files.com/models/as2_partner.rb', line 121 def public_certificate_not_after @attributes[:public_certificate_not_after] end |
#public_certificate_not_after=(value) ⇒ Object
125 126 127 |
# File 'lib/files.com/models/as2_partner.rb', line 125 def public_certificate_not_after=(value) @attributes[:public_certificate_not_after] = value end |
#public_certificate_not_before ⇒ Object
string - Not before value of public certificate used for message security.
112 113 114 |
# File 'lib/files.com/models/as2_partner.rb', line 112 def public_certificate_not_before @attributes[:public_certificate_not_before] end |
#public_certificate_not_before=(value) ⇒ Object
116 117 118 |
# File 'lib/files.com/models/as2_partner.rb', line 116 def public_certificate_not_before=(value) @attributes[:public_certificate_not_before] = value end |
#public_certificate_serial ⇒ Object
string - Serial of public certificate used for message security.
103 104 105 |
# File 'lib/files.com/models/as2_partner.rb', line 103 def public_certificate_serial @attributes[:public_certificate_serial] end |
#public_certificate_serial=(value) ⇒ Object
107 108 109 |
# File 'lib/files.com/models/as2_partner.rb', line 107 def public_certificate_serial=(value) @attributes[:public_certificate_serial] = value end |
#public_certificate_subject ⇒ Object
string - Subject of public certificate used for message security.
85 86 87 |
# File 'lib/files.com/models/as2_partner.rb', line 85 def public_certificate_subject @attributes[:public_certificate_subject] end |
#public_certificate_subject=(value) ⇒ Object
89 90 91 |
# File 'lib/files.com/models/as2_partner.rb', line 89 def public_certificate_subject=(value) @attributes[:public_certificate_subject] = value end |
#save ⇒ Object
172 173 174 175 176 177 178 179 |
# File 'lib/files.com/models/as2_partner.rb', line 172 def save if @attributes[:id] update(@attributes) else new_obj = As2Partner.create(@attributes, @options) @attributes = new_obj.attributes end end |
#server_certificate ⇒ Object
string - Remote server certificate security setting
49 50 51 |
# File 'lib/files.com/models/as2_partner.rb', line 49 def server_certificate @attributes[:server_certificate] end |
#server_certificate=(value) ⇒ Object
53 54 55 |
# File 'lib/files.com/models/as2_partner.rb', line 53 def server_certificate=(value) @attributes[:server_certificate] = value end |
#update(params = {}) ⇒ Object
Parameters:
name - string - AS2 Name
uri - string - URL base for AS2 responses
server_certificate - string - Remote server certificate security setting
public_certificate - string
enable_dedicated_ips - boolean
144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/files.com/models/as2_partner.rb', line 144 def update(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer) raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String) raise InvalidParameterError.new("Bad parameter: uri must be an String") if params[:uri] and !params[:uri].is_a?(String) raise InvalidParameterError.new("Bad parameter: server_certificate must be an String") if params[:server_certificate] and !params[:server_certificate].is_a?(String) raise InvalidParameterError.new("Bad parameter: public_certificate must be an String") if params[:public_certificate] and !params[:public_certificate].is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params[:id] Api.send_request("/as2_partners/#{@attributes[:id]}", :patch, params, @options) end |
#uri ⇒ Object
string - Public URI for sending AS2 message to.
40 41 42 |
# File 'lib/files.com/models/as2_partner.rb', line 40 def uri @attributes[:uri] end |
#uri=(value) ⇒ Object
44 45 46 |
# File 'lib/files.com/models/as2_partner.rb', line 44 def uri=(value) @attributes[:uri] = value end |