Class: Files::ActionNotificationExport

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/action_notification_export.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ ActionNotificationExport

Returns a new instance of ActionNotificationExport.



7
8
9
10
# File 'lib/files.com/models/action_notification_export.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/action_notification_export.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/action_notification_export.rb', line 5

def options
  @options
end

Class Method Details

.create(params = {}, options = {}) ⇒ Object

Parameters:

user_id - int64 - User ID.  Provide a value of `0` to operate the current session's user.
start_at - string - Start date/time of export range.
end_at - string - End date/time of export range.
query_message - string - Error message associated with the request, if any.
query_request_method - string - The HTTP request method used by the webhook.
query_request_url - string - The target webhook URL.
query_status - string - The HTTP status returned from the server in response to the webhook request.
query_success - boolean - true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise.
query_path - string - Return notifications that were triggered by actions on this specific path.
query_folder - string - Return notifications that were triggered by actions in this folder.


176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/files.com/models/action_notification_export.rb', line 176

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: start_at must be an String") if params[:start_at] and !params[:start_at].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: end_at must be an String") if params[:end_at] and !params[:end_at].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_message must be an String") if params[:query_message] and !params[:query_message].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_request_method must be an String") if params[:query_request_method] and !params[:query_request_method].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_request_url must be an String") if params[:query_request_url] and !params[:query_request_url].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_status must be an String") if params[:query_status] and !params[:query_status].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_path must be an String") if params[:query_path] and !params[:query_path].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: query_folder must be an String") if params[:query_folder] and !params[:query_folder].is_a?(String)

  response, options = Api.send_request("/action_notification_exports", :post, params, options)
  ActionNotificationExport.new(response.data, options)
end

.find(id, params = {}, options = {}) ⇒ Object

Parameters:

id (required) - int64 - Action Notification Export ID.


151
152
153
154
155
156
157
158
159
# File 'lib/files.com/models/action_notification_export.rb', line 151

def self.find(id, params = {}, options = {})
  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, options = Api.send_request("/action_notification_exports/#{params[:id]}", :get, params, options)
  ActionNotificationExport.new(response.data, options)
end

.get(id, params = {}, options = {}) ⇒ Object



161
162
163
# File 'lib/files.com/models/action_notification_export.rb', line 161

def self.get(id, params = {}, options = {})
  find(id, params, options)
end

Instance Method Details

#end_atObject

date-time - End date/time of export range.



40
41
42
# File 'lib/files.com/models/action_notification_export.rb', line 40

def end_at
  @attributes[:end_at]
end

#end_at=(value) ⇒ Object



44
45
46
# File 'lib/files.com/models/action_notification_export.rb', line 44

def end_at=(value)
  @attributes[:end_at] = value
end

#export_versionObject

string - Version of the underlying records for the export.



22
23
24
# File 'lib/files.com/models/action_notification_export.rb', line 22

def export_version
  @attributes[:export_version]
end

#export_version=(value) ⇒ Object



26
27
28
# File 'lib/files.com/models/action_notification_export.rb', line 26

def export_version=(value)
  @attributes[:export_version] = value
end

#idObject

int64 - History Export ID



13
14
15
# File 'lib/files.com/models/action_notification_export.rb', line 13

def id
  @attributes[:id]
end

#id=(value) ⇒ Object



17
18
19
# File 'lib/files.com/models/action_notification_export.rb', line 17

def id=(value)
  @attributes[:id] = value
end

#query_folderObject

string - Return notifications that were triggered by actions in this folder.



67
68
69
# File 'lib/files.com/models/action_notification_export.rb', line 67

def query_folder
  @attributes[:query_folder]
end

#query_folder=(value) ⇒ Object



71
72
73
# File 'lib/files.com/models/action_notification_export.rb', line 71

def query_folder=(value)
  @attributes[:query_folder] = value
end

#query_messageObject

string - Error message associated with the request, if any.



76
77
78
# File 'lib/files.com/models/action_notification_export.rb', line 76

def query_message
  @attributes[:query_message]
end

#query_message=(value) ⇒ Object



80
81
82
# File 'lib/files.com/models/action_notification_export.rb', line 80

def query_message=(value)
  @attributes[:query_message] = value
end

#query_pathObject

string - Return notifications that were triggered by actions on this specific path.



58
59
60
# File 'lib/files.com/models/action_notification_export.rb', line 58

def query_path
  @attributes[:query_path]
end

#query_path=(value) ⇒ Object



62
63
64
# File 'lib/files.com/models/action_notification_export.rb', line 62

def query_path=(value)
  @attributes[:query_path] = value
end

#query_request_methodObject

string - The HTTP request method used by the webhook.



85
86
87
# File 'lib/files.com/models/action_notification_export.rb', line 85

def query_request_method
  @attributes[:query_request_method]
end

#query_request_method=(value) ⇒ Object



89
90
91
# File 'lib/files.com/models/action_notification_export.rb', line 89

def query_request_method=(value)
  @attributes[:query_request_method] = value
end

#query_request_urlObject

string - The target webhook URL.



94
95
96
# File 'lib/files.com/models/action_notification_export.rb', line 94

def query_request_url
  @attributes[:query_request_url]
end

#query_request_url=(value) ⇒ Object



98
99
100
# File 'lib/files.com/models/action_notification_export.rb', line 98

def query_request_url=(value)
  @attributes[:query_request_url] = value
end

#query_statusObject

string - The HTTP status returned from the server in response to the webhook request.



103
104
105
# File 'lib/files.com/models/action_notification_export.rb', line 103

def query_status
  @attributes[:query_status]
end

#query_status=(value) ⇒ Object



107
108
109
# File 'lib/files.com/models/action_notification_export.rb', line 107

def query_status=(value)
  @attributes[:query_status] = value
end

#query_successObject

boolean - true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise.



112
113
114
# File 'lib/files.com/models/action_notification_export.rb', line 112

def query_success
  @attributes[:query_success]
end

#query_success=(value) ⇒ Object



116
117
118
# File 'lib/files.com/models/action_notification_export.rb', line 116

def query_success=(value)
  @attributes[:query_success] = value
end

#results_urlObject

string - If ‘status` is `ready`, this will be a URL where all the results can be downloaded at once as a CSV.



121
122
123
# File 'lib/files.com/models/action_notification_export.rb', line 121

def results_url
  @attributes[:results_url]
end

#results_url=(value) ⇒ Object



125
126
127
# File 'lib/files.com/models/action_notification_export.rb', line 125

def results_url=(value)
  @attributes[:results_url] = value
end

#saveObject



138
139
140
141
142
143
144
145
146
147
# File 'lib/files.com/models/action_notification_export.rb', line 138

def save
  if @attributes[:id]
    raise NotImplementedError.new("The ActionNotificationExport object doesn't support updates.")
  else
    new_obj = ActionNotificationExport.create(@attributes, @options)
  end

  @attributes = new_obj.attributes
  true
end

#start_atObject

date-time - Start date/time of export range.



31
32
33
# File 'lib/files.com/models/action_notification_export.rb', line 31

def start_at
  @attributes[:start_at]
end

#start_at=(value) ⇒ Object



35
36
37
# File 'lib/files.com/models/action_notification_export.rb', line 35

def start_at=(value)
  @attributes[:start_at] = value
end

#statusObject

string - Status of export. Valid values: ‘building`, `ready`, or `failed`



49
50
51
# File 'lib/files.com/models/action_notification_export.rb', line 49

def status
  @attributes[:status]
end

#status=(value) ⇒ Object



53
54
55
# File 'lib/files.com/models/action_notification_export.rb', line 53

def status=(value)
  @attributes[:status] = value
end

#user_idObject

int64 - User ID. Provide a value of ‘0` to operate the current session’s user.



130
131
132
# File 'lib/files.com/models/action_notification_export.rb', line 130

def user_id
  @attributes[:user_id]
end

#user_id=(value) ⇒ Object



134
135
136
# File 'lib/files.com/models/action_notification_export.rb', line 134

def user_id=(value)
  @attributes[:user_id] = value
end