# The content of this file was automatically generated require "cgi" require "processout/networking/request" require "processout/networking/response" module ProcessOut class WebhookEndpoint attr_reader :id attr_reader :project attr_reader :project_id attr_reader :url attr_reader :events_whitelist attr_reader :sandbox attr_reader :created_at def id=(val) @id = val end def project=(val) if val.nil? @project = val return end if val.instance_of? Project @project = val else obj = Project.new(@client) obj.fill_with_data(val) @project = obj end end def project_id=(val) @project_id = val end def url=(val) @url = val end def events_whitelist=(val) @events_whitelist = val end def sandbox=(val) @sandbox = val end def created_at=(val) @created_at = val end # Initializes the WebhookEndpoint object # Params: # +client+:: +ProcessOut+ client instance # +data+:: data that can be used to fill the object def initialize(client, data = {}) @client = client self.id = data.fetch(:id, nil) self.project = data.fetch(:project, nil) self.project_id = data.fetch(:project_id, nil) self.url = data.fetch(:url, nil) self.events_whitelist = data.fetch(:events_whitelist, nil) self.sandbox = data.fetch(:sandbox, nil) self.created_at = data.fetch(:created_at, nil) end # Create a new WebhookEndpoint using the current client def new(data = {}) WebhookEndpoint.new(@client, data) end # Fills the object with data coming from the API # Params: # +data+:: +Hash+ of data coming from the API def fill_with_data(data) if data.nil? return self end if data.include? "id" self.id = data["id"] end if data.include? "project" self.project = data["project"] end if data.include? "project_id" self.project_id = data["project_id"] end if data.include? "url" self.url = data["url"] end if data.include? "events_whitelist" self.events_whitelist = data["events_whitelist"] end if data.include? "sandbox" self.sandbox = data["sandbox"] end if data.include? "created_at" self.created_at = data["created_at"] end self end # Prefills the object with the data passed as parameters # Params: # +data+:: +Hash+ of data def prefill(data) if data.nil? return self end self.id = data.fetch(:id, self.id) self.project = data.fetch(:project, self.project) self.project_id = data.fetch(:project_id, self.project_id) self.url = data.fetch(:url, self.url) self.events_whitelist = data.fetch(:events_whitelist, self.events_whitelist) self.sandbox = data.fetch(:sandbox, self.sandbox) self.created_at = data.fetch(:created_at, self.created_at) self end end end