Class: Files::IpAbuseEntry
- Inherits:
-
Object
- Object
- Files::IpAbuseEntry
- Defined in:
- lib/files.com/models/ip_abuse_entry.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: ip (required) - string list - string hostname - string reason - string.
- .create_export(params = {}, options = {}) ⇒ Object
-
.list(params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Used for pagination.
Instance Method Summary collapse
-
#hostname ⇒ Object
string.
- #hostname=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ IpAbuseEntry
constructor
A new instance of IpAbuseEntry.
-
#ip ⇒ Object
string.
- #ip=(value) ⇒ Object
-
#list ⇒ Object
string.
- #list=(value) ⇒ Object
-
#reason ⇒ Object
string.
- #reason=(value) ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ IpAbuseEntry
Returns a new instance of IpAbuseEntry.
7 8 9 10 |
# File 'lib/files.com/models/ip_abuse_entry.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/ip_abuse_entry.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 5 def @options end |
Class Method Details
.all(params = {}, options = {}) ⇒ Object
70 71 72 73 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 70 def self.all(params = {}, = {}) list(params, ) nil end |
.create(params = {}, options = {}) ⇒ Object
Parameters:
ip (required) - string
list - string
hostname - string
reason - string
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 80 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: ip must be an String") if params[:ip] and !params[:ip].is_a?(String) raise InvalidParameterError.new("Bad parameter: list must be an String") if params[:list] and !params[:list].is_a?(String) raise InvalidParameterError.new("Bad parameter: hostname must be an String") if params[:hostname] and !params[:hostname].is_a?(String) raise InvalidParameterError.new("Bad parameter: reason must be an String") if params[:reason] and !params[:reason].is_a?(String) raise MissingParameterError.new("Parameter missing: ip") unless params[:ip] Api.send_request("/ip_abuse_entries", :post, params, ) nil end |
.create_export(params = {}, options = {}) ⇒ Object
91 92 93 94 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 91 def self.create_export(params = {}, = {}) response, = Api.send_request("/ip_abuse_entries/create_export", :post, params, ) Export.new(response.data, ) 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: 10000, 1,000 or less is recommended).
62 63 64 65 66 67 68 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 62 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) Api.send_request("/ip_abuse_entries", :get, params, ) nil end |
Instance Method Details
#hostname ⇒ Object
string
31 32 33 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 31 def hostname @attributes[:hostname] end |
#hostname=(value) ⇒ Object
35 36 37 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 35 def hostname=(value) @attributes[:hostname] = value end |
#ip ⇒ Object
string
13 14 15 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 13 def ip @attributes[:ip] end |
#ip=(value) ⇒ Object
17 18 19 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 17 def ip=(value) @attributes[:ip] = value end |
#list ⇒ Object
string
22 23 24 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 22 def list @attributes[:list] end |
#list=(value) ⇒ Object
26 27 28 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 26 def list=(value) @attributes[:list] = value end |
#reason ⇒ Object
string
40 41 42 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 40 def reason @attributes[:reason] end |
#reason=(value) ⇒ Object
44 45 46 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 44 def reason=(value) @attributes[:reason] = value end |
#save ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/files.com/models/ip_abuse_entry.rb', line 48 def save if @attributes[:id] raise NotImplementedError.new("The IpAbuseEntry object doesn't support updates.") else new_obj = IpAbuseEntry.create(@attributes, @options) end @attributes = new_obj.attributes true end |