Class: OpenApiSDK::Dub
- Inherits:
-
Object
- Object
- OpenApiSDK::Dub
- Extended by:
- T::Sig
- Defined in:
- lib/open_api_sdk/dub.rb
Instance Attribute Summary collapse
-
#analytics ⇒ Object
Returns the value of attribute analytics.
-
#domains ⇒ Object
Returns the value of attribute domains.
-
#links ⇒ Object
Returns the value of attribute links.
-
#metatags ⇒ Object
Returns the value of attribute metatags.
-
#qr_codes ⇒ Object
Returns the value of attribute qr_codes.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#track ⇒ Object
Returns the value of attribute track.
-
#workspaces ⇒ Object
Returns the value of attribute workspaces.
Instance Method Summary collapse
- #config_security(security) ⇒ Object
- #config_server(server_idx) ⇒ Object
- #config_server_url(server_url) ⇒ Object
- #init_sdks ⇒ Object
-
#initialize(client: nil, security: nil, server_idx: nil, server_url: nil, url_params: nil) ⇒ Dub
constructor
A new instance of Dub.
Constructor Details
#initialize(client: nil, security: nil, server_idx: nil, server_url: nil, url_params: nil) ⇒ Dub
Returns a new instance of Dub.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/open_api_sdk/dub.rb', line 25 def initialize(client: nil, security: nil, server_idx: nil, server_url: nil, url_params: nil) ## Instantiates the SDK configuring it with the provided parameters. # @param [Faraday::Request] client The faraday HTTP client to use for all operations # @param [Shared::Security] security The security details required for authentication # @param [::Integer] server_idx The index of the server to use for all operations # @param [::String] server_url The server URL to use for all operations # @param [::Hash<::Symbol, ::String>] url_params Parameters to optionally template the server URL with if client.nil? client = Faraday.new(request: { params_encoder: Faraday::FlatParamsEncoder }) do |f| f.request :multipart, {} # f.response :logger end end if !server_url.nil? if !url_params.nil? server_url = Utils.template_url(server_url, url_params) end end server_idx = 0 if server_idx.nil? @sdk_configuration = SDKConfiguration.new(client, security, server_url, server_idx) init_sdks end |
Instance Attribute Details
#analytics ⇒ Object
Returns the value of attribute analytics.
16 17 18 |
# File 'lib/open_api_sdk/dub.rb', line 16 def analytics @analytics end |
#domains ⇒ Object
Returns the value of attribute domains.
16 17 18 |
# File 'lib/open_api_sdk/dub.rb', line 16 def domains @domains end |
#links ⇒ Object
Returns the value of attribute links.
16 17 18 |
# File 'lib/open_api_sdk/dub.rb', line 16 def links @links end |
#metatags ⇒ Object
Returns the value of attribute metatags.
16 17 18 |
# File 'lib/open_api_sdk/dub.rb', line 16 def @metatags end |
#qr_codes ⇒ Object
Returns the value of attribute qr_codes.
16 17 18 |
# File 'lib/open_api_sdk/dub.rb', line 16 def qr_codes @qr_codes end |
#tags ⇒ Object
Returns the value of attribute tags.
16 17 18 |
# File 'lib/open_api_sdk/dub.rb', line 16 def @tags end |
#track ⇒ Object
Returns the value of attribute track.
16 17 18 |
# File 'lib/open_api_sdk/dub.rb', line 16 def track @track end |
#workspaces ⇒ Object
Returns the value of attribute workspaces.
16 17 18 |
# File 'lib/open_api_sdk/dub.rb', line 16 def workspaces @workspaces end |
Instance Method Details
#config_security(security) ⇒ Object
72 73 74 |
# File 'lib/open_api_sdk/dub.rb', line 72 def config_security(security) @sdk_configuration.security = security end |
#config_server(server_idx) ⇒ Object
65 66 67 68 69 |
# File 'lib/open_api_sdk/dub.rb', line 65 def config_server(server_idx) raise StandardError, "Invalid server index #{server_idx}" if server_idx.negative? || server_idx >= SERVERS.length @sdk_configuration.server_idx = server_idx init_sdks end |
#config_server_url(server_url) ⇒ Object
59 60 61 62 |
# File 'lib/open_api_sdk/dub.rb', line 59 def config_server_url(server_url) @sdk_configuration.server_url = server_url init_sdks end |
#init_sdks ⇒ Object
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/open_api_sdk/dub.rb', line 77 def init_sdks @links = Links.new(@sdk_configuration) @qr_codes = QRCodes.new(@sdk_configuration) @analytics = Analytics.new(@sdk_configuration) @workspaces = Workspaces.new(@sdk_configuration) @tags = Tags.new(@sdk_configuration) @domains = Domains.new(@sdk_configuration) @track = Track.new(@sdk_configuration) @metatags = Metatags.new(@sdk_configuration) end |