Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regex warning in bank_account.rb #225

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions lib/openapi_client/models/bank_account.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=begin
#Lob

#The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
#The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?

The version of the OpenAPI document: 1.3.0
Contact: [email protected]
Expand All @@ -15,7 +15,7 @@

module Lob
class BankAccount
# An internal description that identifies this resource. Must be no longer than 255 characters.
# An internal description that identifies this resource. Must be no longer than 255 characters.
attr_accessor :description

# Must be a [valid US routing number](https://www.frbservices.org/index.html).
Expand Down Expand Up @@ -257,7 +257,7 @@ def list_invalid_properties
invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
end

pattern = Regexp.new(/^https:\/\/lob-assets.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(''|_signature)(.pdf|_thumb_[a-z]+_[0-9]+.png|.png)\?(version=[a-z0-9]*&)expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+/)
pattern = lob_assets_url_regex
if !@signature_url.nil? && @signature_url !~ pattern
invalid_properties.push("invalid value for \"signature_url\", must conform to the pattern #{pattern}.")
end
Expand Down Expand Up @@ -293,7 +293,7 @@ def valid?
return false if @signatory.to_s.length > 30
return false if @id.nil?
return false if @id !~ Regexp.new(/^bank_[a-zA-Z0-9]+$/)
return false if !@signature_url.nil? && @signature_url !~ Regexp.new(/^https:\/\/lob-assets.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(''|_signature)(.pdf|_thumb_[a-z]+_[0-9]+.png|.png)\?(version=[a-z0-9]*&)expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+/)
return false if !@signature_url.nil? && @signature_url !~ lob_assets_url_regex
return false if @date_created.nil?
return false if @date_modified.nil?
return false if @object.nil?
Expand Down Expand Up @@ -392,7 +392,7 @@ def id=(id)
# Custom attribute writer method with validation
# @param [Object] signature_url Value to be assigned
def signature_url=(signature_url)
pattern = Regexp.new(/^https:\/\/lob-assets.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(''|_signature)(.pdf|_thumb_[a-z]+_[0-9]+.png|.png)\?(version=[a-z0-9]*&)expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+/)
pattern = lob_assets_url_regex
if !signature_url.nil? && signature_url !~ pattern
fail ArgumentError, "invalid value for \"signature_url\", must conform to the pattern #{pattern}."
end
Expand Down Expand Up @@ -571,6 +571,10 @@ def _to_hash(value)
end
end

def lob_assets_url_regex
Regexp.new(/^https:\/\/lob-assets.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(''|_signature)(.pdf|_thumb_[a-z]+_[0-9]+.png|.png)\?(version=[a-z0-9]*&)expires=[0-9]{10}&signature=[a-zA-Z0-9\-_]+/)
end

end

end