Class: RockRMS::Client
- Inherits:
-
Object
- Object
- RockRMS::Client
- Includes:
- RecurringFrequencies, Attribute, AttributeValue, Batch, BinaryFile, Block, BlockType, Campus, ContentChannel, ContentChannelItem, ContentChannelType, DefinedType, DefinedValue, ExceptionLog, Fund, Gateway, Group, GroupMember, History, LavaShortcode, Page, PaymentDetail, Person, PhoneNumber, RecurringDonation, RecurringDonationDetail, Refund, RefundReason, Registration, SavedPaymentMethod, ServiceJob, SystemCommunication, SystemEmail, Transaction, TransactionDetail, TransactionImage, UserLogin, Utility, WorkflowActionType, WorkflowActivityType, WorkflowType, TransformHashKeys
- Defined in:
- lib/rock_rms/client.rb,
lib/rock_rms/resources/fund.rb,
lib/rock_rms/resources/page.rb,
lib/rock_rms/resources/batch.rb,
lib/rock_rms/resources/block.rb,
lib/rock_rms/resources/group.rb,
lib/rock_rms/resources/campus.rb,
lib/rock_rms/resources/person.rb,
lib/rock_rms/resources/refund.rb,
lib/rock_rms/resources/gateway.rb,
lib/rock_rms/resources/history.rb,
lib/rock_rms/resources/version.rb,
lib/rock_rms/resources/attribute.rb,
lib/rock_rms/resources/block_type.rb,
lib/rock_rms/resources/user_login.rb,
lib/rock_rms/resources/binary_file.rb,
lib/rock_rms/resources/service_job.rb,
lib/rock_rms/resources/transaction.rb,
lib/rock_rms/resources/defined_type.rb,
lib/rock_rms/resources/group_member.rb,
lib/rock_rms/resources/phone_number.rb,
lib/rock_rms/resources/registration.rb,
lib/rock_rms/resources/system_email.rb,
lib/rock_rms/resources/defined_value.rb,
lib/rock_rms/resources/exception_log.rb,
lib/rock_rms/resources/refund_reason.rb,
lib/rock_rms/resources/workflow_type.rb,
lib/rock_rms/resources/lava_shortcode.rb,
lib/rock_rms/resources/payment_detail.rb,
lib/rock_rms/resources/attribute_value.rb,
lib/rock_rms/resources/content_channel.rb,
lib/rock_rms/resources/transaction_image.rb,
lib/rock_rms/resources/recurring_donation.rb,
lib/rock_rms/resources/transaction_detail.rb,
lib/rock_rms/resources/content_channel_item.rb,
lib/rock_rms/resources/content_channel_type.rb,
lib/rock_rms/resources/saved_payment_method.rb,
lib/rock_rms/resources/system_communication.rb,
lib/rock_rms/resources/workflow_action_type.rb,
lib/rock_rms/resources/workflow_activity_type.rb,
lib/rock_rms/resources/recurring_donation_detail.rb
Defined Under Namespace
Modules: Attribute, AttributeValue, Batch, BinaryFile, Block, BlockType, Campus, ContentChannel, ContentChannelItem, ContentChannelType, DefinedType, DefinedValue, ExceptionLog, Fund, Gateway, Group, GroupMember, History, LavaShortcode, Page, PaymentDetail, Person, PhoneNumber, RecurringDonation, RecurringDonationDetail, Refund, RefundReason, Registration, SavedPaymentMethod, ServiceJob, SystemCommunication, SystemEmail, Transaction, TransactionDetail, TransactionImage, UserLogin, Utility, WorkflowActionType, WorkflowActivityType, WorkflowType
Constant Summary
Constants included from WorkflowType
Constants included from WorkflowActivityType
Constants included from WorkflowActionType
Constants included from Transaction
Constants included from Registration
Constants included from Refund
Constants included from Person
Constants included from Gateway
Constants included from RecurringFrequencies
RecurringFrequencies::RECURRING_FREQUENCIES
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#authorization_token ⇒ Object
readonly
Returns the value of attribute authorization_token.
-
#cookie ⇒ Object
readonly
Returns the value of attribute cookie.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
-
#ssl ⇒ Object
readonly
Returns the value of attribute ssl.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #delete(path, options = {}) ⇒ Object
- #get(path, options = {}) ⇒ Object
-
#initialize(url:, username: nil, password: nil, authorization_token: nil, logger: true, adapter: Faraday.default_adapter, ssl: nil, proxy: nil) ⇒ Client
constructor
A new instance of Client.
- #patch(path, options = {}) ⇒ Object
- #post(path, options = {}) ⇒ Object
- #put(path, options = {}) ⇒ Object
Methods included from WorkflowType
#find_workflow_type, #list_workflow_types
Methods included from WorkflowActivityType
#find_workflow_activity_type, #list_workflow_activity_types
Methods included from WorkflowActionType
#find_workflow_action_type, #list_workflow_action_types
Methods included from Utility
Methods included from UserLogin
#create_user_login, #list_user_logins, #update_user_login
Methods included from TransactionImage
Methods included from TransactionDetail
#create_transaction_detail, #delete_transaction_detail, #find_transaction_detail, #list_transaction_details, #update_transaction_detail
Methods included from Transaction
#create_transaction, #delete_transaction, #find_donations_by_giving_id, #find_transaction, #launch_transaction_workflow, #list_transactions, #refund_transaction, #update_transaction
Methods included from SystemEmail
#list_system_emails, #update_system_email
Methods included from SystemCommunication
#list_system_communications, #update_system_communcation
Methods included from ServiceJob
#list_service_jobs, #update_service_job
Methods included from SavedPaymentMethod
#create_saved_payment_method, #delete_saved_payment_method, #list_saved_payment_methods, #update_saved_payment_method
Methods included from Registration
#delete_registration, #find_registration, #list_registrations
Methods included from RefundReason
#create_refund_reason, #list_refund_reasons
Methods included from Refund
Methods included from RecurringDonationDetail
#create_recurring_donation_detail, #delete_recurring_donation_detail, #update_recurring_donation_detail
Methods included from RecurringDonation
#create_recurring_donation, #delete_recurring_donation, #find_recurring_donation, #launch_scheduled_transaction_workflow, #list_recurring_donations, #update_recurring_donation
Methods included from PhoneNumber
#create_phone_number, #list_phone_numbers
Methods included from Person
#create_business, #create_person, #find_person, #find_person_by_alias_id, #find_person_by_email, #find_person_by_name, #launch_person_workflow, #list_people, #update_person
Methods included from PaymentDetail
#create_payment_detail, #delete_payment_detail, #list_payment_details, #update_payment_detail
Methods included from Page
Methods included from LavaShortcode
#create_lava_shortcode, #find_lava_shortcode, #list_lava_shortcodes, #update_lava_shortcode
Methods included from History
Methods included from GroupMember
#create_group_member, #create_known_relationship, #delete_group_member, #list_group_members
Methods included from Group
#find_group, #list_families_for_person, #list_groups, #list_groups_for_person, #save_group_address
Methods included from Gateway
#delete_gateway, #list_gateways
Methods included from ExceptionLog
Methods included from DefinedValue
#create_defined_value, #list_defined_values
Methods included from DefinedType
#find_defined_type, #list_defined_types
Methods included from ContentChannelItem
Methods included from ContentChannelType
Methods included from ContentChannel
#find_content_channel, #list_content_channels, #update_content_channel
Methods included from Campus
Methods included from Fund
#create_fund, #find_fund, #list_funds
Methods included from BlockType
#block_type_path, #list_block_types
Methods included from Block
Methods included from BinaryFile
Methods included from Batch
#create_batch, #delete_batch, #find_batch, #list_batches, #update_batch
Methods included from AttributeValue
#create_attribute_value, #list_attribute_values, #update_attribute_value
Methods included from Attribute
#create_attribute, #list_attributes
Methods included from TransformHashKeys
Constructor Details
#initialize(url:, username: nil, password: nil, authorization_token: nil, logger: true, adapter: Faraday.default_adapter, ssl: nil, proxy: nil) ⇒ Client
Returns a new instance of Client.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/rock_rms/client.rb', line 57 def initialize(url:, username: nil, password: nil, authorization_token: nil, logger: true, adapter: Faraday.default_adapter, ssl: nil, proxy: nil) if username.nil? && password.nil? && .nil? raise ArgumentError, 'either username and password or authorization_token is required' end @url = "#{url}/api/" @username = username unless @password = password unless @authorization_token = unless username && password @logger = logger @adapter = adapter @ssl = ssl @proxy = proxy @cookie = auth['set-cookie'] unless auth.nil? end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
55 56 57 |
# File 'lib/rock_rms/client.rb', line 55 def adapter @adapter end |
#authorization_token ⇒ Object (readonly)
Returns the value of attribute authorization_token.
55 56 57 |
# File 'lib/rock_rms/client.rb', line 55 def @authorization_token end |
#cookie ⇒ Object (readonly)
Returns the value of attribute cookie.
55 56 57 |
# File 'lib/rock_rms/client.rb', line 55 def @cookie end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
55 56 57 |
# File 'lib/rock_rms/client.rb', line 55 def logger @logger end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
55 56 57 |
# File 'lib/rock_rms/client.rb', line 55 def password @password end |
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
55 56 57 |
# File 'lib/rock_rms/client.rb', line 55 def proxy @proxy end |
#ssl ⇒ Object (readonly)
Returns the value of attribute ssl.
55 56 57 |
# File 'lib/rock_rms/client.rb', line 55 def ssl @ssl end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
55 56 57 |
# File 'lib/rock_rms/client.rb', line 55 def url @url end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
55 56 57 |
# File 'lib/rock_rms/client.rb', line 55 def username @username end |
Instance Method Details
#delete(path, options = {}) ⇒ Object
73 74 75 |
# File 'lib/rock_rms/client.rb', line 73 def delete(path, = {}) connection.delete(path, ).body end |
#get(path, options = {}) ⇒ Object
77 78 79 |
# File 'lib/rock_rms/client.rb', line 77 def get(path, = {}) connection.get(path, ).body end |
#patch(path, options = {}) ⇒ Object
81 82 83 |
# File 'lib/rock_rms/client.rb', line 81 def patch(path, = {}) connection.patch(path, ).body end |
#post(path, options = {}) ⇒ Object
85 86 87 |
# File 'lib/rock_rms/client.rb', line 85 def post(path, = {}) connection.post(path, ).body end |
#put(path, options = {}) ⇒ Object
89 90 91 |
# File 'lib/rock_rms/client.rb', line 89 def put(path, = {}) connection.put(path, ).body end |