Class: Io::Flow::V0::Clients::PasswordResetForms
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::PasswordResetForms
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
-
#initialize(client) ⇒ PasswordResetForms
constructor
A new instance of PasswordResetForms.
- #post(password_reset_form, incoming = {}) ⇒ Object
- #post_resets(password_reset_request_form) ⇒ Object
Constructor Details
#initialize(client) ⇒ PasswordResetForms
Returns a new instance of PasswordResetForms.
7852 7853 7854 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7852 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#post(password_reset_form, incoming = {}) ⇒ Object
7856 7857 7858 7859 7860 7861 7862 7863 7864 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7856 def post(password_reset_form, incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) query = { :expand => (x = opts.delete(:expand); x.nil? ? nil : HttpClient::Preconditions.assert_class('expand', x, Array).map { |v| HttpClient::Preconditions.assert_class('expand', v, String) }) }.delete_if { |k, v| v.nil? } (x = password_reset_form; x.is_a?(::Io::Flow::V0::Models::PasswordResetForm) ? x : ::Io::Flow::V0::Models::PasswordResetForm.new(x)) r = @client.request("/users/passwords").with_query(query).with_json(password_reset_form.to_json).post ::Io::Flow::V0::Models::ExpandableUser.from_json(r) end |
#post_resets(password_reset_request_form) ⇒ Object
7866 7867 7868 7869 7870 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7866 def post_resets(password_reset_request_form) (x = password_reset_request_form; x.is_a?(::Io::Flow::V0::Models::PasswordResetRequestForm) ? x : ::Io::Flow::V0::Models::PasswordResetRequestForm.new(x)) r = @client.request("/users/passwords/resets").with_json(password_reset_request_form.to_json).post nil end |