Class: Files::SiteSubdomainRedirect
- Inherits:
-
Object
- Object
- Files::SiteSubdomainRedirect
- Defined in:
- lib/files.com/models/site_subdomain_redirect.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
- .delete(id, params = {}, options = {}) ⇒ Object
- .destroy(id, params = {}, options = {}) ⇒ Object
-
.find(id, params = {}, options = {}) ⇒ Object
Parameters: id (required) - int64 - Site Subdomain Redirect ID.
- .get(id, params = {}, options = {}) ⇒ Object
-
.list(params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Used for pagination.
Instance Method Summary collapse
-
#created_at ⇒ Object
date-time - When this redirect was created.
- #delete(params = {}) ⇒ Object
- #destroy(params = {}) ⇒ Object
-
#id ⇒ Object
int64 - Site subdomain redirect ID.
-
#initialize(attributes = {}, options = {}) ⇒ SiteSubdomainRedirect
constructor
A new instance of SiteSubdomainRedirect.
-
#subdomain ⇒ Object
string - Files.com subdomain that continues to route to the current site subdomain.
-
#updated_at ⇒ Object
date-time - When this redirect was last updated.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ SiteSubdomainRedirect
Returns a new instance of SiteSubdomainRedirect.
7 8 9 10 |
# File 'lib/files.com/models/site_subdomain_redirect.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/site_subdomain_redirect.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 5 def @options end |
Class Method Details
.all(params = {}, options = {}) ⇒ Object
61 62 63 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 61 def self.all(params = {}, = {}) list(params, ) end |
.delete(id, params = {}, options = {}) ⇒ Object
81 82 83 84 85 86 87 88 89 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 81 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] Api.send_request("/site_subdomain_redirects/#{params[:id]}", :delete, params, ) nil end |
.destroy(id, params = {}, options = {}) ⇒ Object
91 92 93 94 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 91 def self.destroy(id, params = {}, = {}) delete(id, params, ) nil end |
.find(id, params = {}, options = {}) ⇒ Object
Parameters:
id (required) - int64 - Site Subdomain Redirect ID.
67 68 69 70 71 72 73 74 75 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 67 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("/site_subdomain_redirects/#{params[:id]}", :get, params, ) SiteSubdomainRedirect.new(response.data, ) end |
.get(id, params = {}, options = {}) ⇒ Object
77 78 79 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 77 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).
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `id`.
51 52 53 54 55 56 57 58 59 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 51 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) raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash) List.new(SiteSubdomainRedirect, params) do Api.send_request("/site_subdomain_redirects", :get, params, ) end end |
Instance Method Details
#created_at ⇒ Object
date-time - When this redirect was created.
23 24 25 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 23 def created_at @attributes[:created_at] end |
#delete(params = {}) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 32 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("/site_subdomain_redirects/#{@attributes[:id]}", :delete, params, @options) end |
#destroy(params = {}) ⇒ Object
42 43 44 45 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 42 def destroy(params = {}) delete(params) nil end |
#id ⇒ Object
int64 - Site subdomain redirect ID.
13 14 15 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 13 def id @attributes[:id] end |
#subdomain ⇒ Object
string - Files.com subdomain that continues to route to the current site subdomain.
18 19 20 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 18 def subdomain @attributes[:subdomain] end |
#updated_at ⇒ Object
date-time - When this redirect was last updated.
28 29 30 |
# File 'lib/files.com/models/site_subdomain_redirect.rb', line 28 def updated_at @attributes[:updated_at] end |