pier-sdk-ruby 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. data/README.md +141 -0
  2. data/docs/AuthToken.md +12 -0
  3. data/docs/BodyAccessToken.md +10 -0
  4. data/docs/CancelarCartaoResponse.md +11 -0
  5. data/docs/CartaoApi.md +252 -0
  6. data/docs/CartaoResponse.md +29 -0
  7. data/docs/ConsultarCartaoResponse.md +10 -0
  8. data/docs/ConsultarContaCartaoResponse.md +18 -0
  9. data/docs/ConsultarContaResponse.md +11 -0
  10. data/docs/ConsultarExtratoContaResponse.md +23 -0
  11. data/docs/ConsultarSaldoLimitesResponse.md +23 -0
  12. data/docs/ContaApi.md +238 -0
  13. data/docs/ContaCartaoResponse.md +21 -0
  14. data/docs/ContaResponse.md +41 -0
  15. data/docs/DesbloquearCartaoResponse.md +9 -0
  16. data/docs/ExtraInfo.md +8 -0
  17. data/docs/ExtratoResponse.md +35 -0
  18. data/docs/PessoaFisicaResponse.md +26 -0
  19. data/docs/SaldoLimiteResponse.md +39 -0
  20. data/docs/TokenApi.md +114 -0
  21. data/git_push.sh +52 -0
  22. data/lib/pier-sdk-ruby.rb +62 -0
  23. data/lib/pier-sdk-ruby/api/cartao_api.rb +355 -0
  24. data/lib/pier-sdk-ruby/api/conta_api.rb +324 -0
  25. data/lib/pier-sdk-ruby/api/token_api.rb +157 -0
  26. data/lib/pier-sdk-ruby/api_client.rb +368 -0
  27. data/lib/pier-sdk-ruby/api_error.rb +40 -0
  28. data/lib/pier-sdk-ruby/configuration.rb +177 -0
  29. data/lib/pier-sdk-ruby/models/auth_token.rb +325 -0
  30. data/lib/pier-sdk-ruby/models/body_access_token.rb +275 -0
  31. data/lib/pier-sdk-ruby/models/cancelar_cartao_response.rb +286 -0
  32. data/lib/pier-sdk-ruby/models/cartao_response.rb +736 -0
  33. data/lib/pier-sdk-ruby/models/consultar_cartao_response.rb +263 -0
  34. data/lib/pier-sdk-ruby/models/consultar_conta_cartao_response.rb +461 -0
  35. data/lib/pier-sdk-ruby/models/consultar_conta_response.rb +288 -0
  36. data/lib/pier-sdk-ruby/models/consultar_extrato_conta_response.rb +588 -0
  37. data/lib/pier-sdk-ruby/models/consultar_saldo_limites_response.rb +586 -0
  38. data/lib/pier-sdk-ruby/models/conta_cartao_response.rb +536 -0
  39. data/lib/pier-sdk-ruby/models/conta_response.rb +1036 -0
  40. data/lib/pier-sdk-ruby/models/desbloquear_cartao_response.rb +236 -0
  41. data/lib/pier-sdk-ruby/models/extra_info.rb +211 -0
  42. data/lib/pier-sdk-ruby/models/extrato_response.rb +886 -0
  43. data/lib/pier-sdk-ruby/models/pessoa_fisica_response.rb +661 -0
  44. data/lib/pier-sdk-ruby/models/saldo_limite_response.rb +986 -0
  45. data/lib/pier-sdk-ruby/version.rb +19 -0
  46. data/pier-sdk-ruby.gemspec +33 -0
  47. data/spec/api/cartao_api_spec.rb +110 -0
  48. data/spec/api/conta_api_spec.rb +107 -0
  49. data/spec/api/token_api_spec.rb +71 -0
  50. data/spec/models/auth_token_spec.rb +90 -0
  51. data/spec/models/body_access_token_spec.rb +70 -0
  52. data/spec/models/cancelar_cartao_response_spec.rb +80 -0
  53. data/spec/models/cartao_response_spec.rb +260 -0
  54. data/spec/models/consultar_cartao_response_spec.rb +70 -0
  55. data/spec/models/consultar_conta_cartao_response_spec.rb +150 -0
  56. data/spec/models/consultar_conta_response_spec.rb +80 -0
  57. data/spec/models/consultar_extrato_conta_response_spec.rb +200 -0
  58. data/spec/models/consultar_saldo_limites_response_spec.rb +200 -0
  59. data/spec/models/conta_cartao_response_spec.rb +180 -0
  60. data/spec/models/conta_response_spec.rb +380 -0
  61. data/spec/models/desbloquear_cartao_response_spec.rb +60 -0
  62. data/spec/models/extra_info_spec.rb +50 -0
  63. data/spec/models/extrato_response_spec.rb +320 -0
  64. data/spec/models/pessoa_fisica_response_spec.rb +230 -0
  65. data/spec/models/saldo_limite_response_spec.rb +360 -0
  66. metadata +310 -0
@@ -0,0 +1,26 @@
1
+ # Pier::PessoaFisicaResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **bairro** | **String** | | [optional]
7
+ **cep** | **String** | | [optional]
8
+ **cidade** | **String** | | [optional]
9
+ **complemento_logradouro** | **String** | | [optional]
10
+ **cpf** | **String** | | [optional]
11
+ **data_emissao_identidade** | **String** | | [optional]
12
+ **data_nascimento** | **String** | | [optional]
13
+ **dddcelular** | **String** | | [optional]
14
+ **dddtelefone** | **String** | | [optional]
15
+ **endereco** | **String** | | [optional]
16
+ **id_pessoa_fisica** | **Integer** | | [optional]
17
+ **identidade** | **String** | | [optional]
18
+ **nome** | **String** | | [optional]
19
+ **numero_celular** | **String** | | [optional]
20
+ **numero_logradouro** | **Integer** | | [optional]
21
+ **numero_telefone** | **String** | | [optional]
22
+ **orgao_emissor** | **String** | | [optional]
23
+ **sexo** | **String** | | [optional]
24
+ **uf** | **String** | | [optional]
25
+
26
+
@@ -0,0 +1,39 @@
1
+ # Pier::SaldoLimiteResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **disponib_compra_nac** | **Float** | | [optional]
7
+ **disponib_global_credito** | **Float** | | [optional]
8
+ **disponib_parcelado_nac** | **Float** | | [optional]
9
+ **disponib_parcelas_nac** | **Float** | | [optional]
10
+ **disponib_saque_nac_global** | **Float** | | [optional]
11
+ **flag_antecipacao** | **BOOLEAN** | | [optional]
12
+ **limite_compra_nac** | **Float** | | [optional]
13
+ **limite_credito_concedido** | **Float** | | [optional]
14
+ **limite_credito_disponivel** | **Float** | | [optional]
15
+ **limite_global_credito** | **Float** | | [optional]
16
+ **limite_parcelado_nac** | **Float** | | [optional]
17
+ **limite_parcelas_nac** | **Float** | | [optional]
18
+ **limite_pontuacao** | **Float** | | [optional]
19
+ **limite_saque_nac_global** | **Float** | | [optional]
20
+ **numero_ciclo** | **Integer** | | [optional]
21
+ **pontos_concedidos** | **Float** | | [optional]
22
+ **pontos_remanescentes** | **Float** | | [optional]
23
+ **proximo_vencimento_padrao** | **String** | | [optional]
24
+ **proximo_vencimento_real** | **String** | | [optional]
25
+ **saldo_atual_final** | **Float** | | [optional]
26
+ **saldo_credor** | **Float** | | [optional]
27
+ **saldo_devedor** | **Float** | | [optional]
28
+ **saldo_devedor_oneroso** | **Float** | | [optional]
29
+ **saldo_devedor_total** | **Float** | | [optional]
30
+ **salta_extrato_anterior** | **Float** | | [optional]
31
+ **total_disponivel_utilizacao** | **Float** | | [optional]
32
+ **total_futuro** | **Float** | | [optional]
33
+ **valor_minimo_extrato** | **Float** | | [optional]
34
+ **valor_minimo_extrato_original** | **Float** | | [optional]
35
+ **vencimento_padrao_anterior** | **String** | | [optional]
36
+ **vencimento_pos_prox** | **String** | | [optional]
37
+ **vencimento_real_anterior** | **String** | | [optional]
38
+
39
+
data/docs/TokenApi.md ADDED
@@ -0,0 +1,114 @@
1
+ # Pier::TokenApi
2
+
3
+ All URIs are relative to *https://localhost/*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**callback_using_post**](TokenApi.md#callback_using_post) | **POST** /v1/tokens/callback | /tokens/callback
8
+ [**validar_using_post**](TokenApi.md#validar_using_post) | **POST** /v1/tokens/validar | /tokens/validar
9
+
10
+
11
+ # **callback_using_post**
12
+ > BodyAccessToken callback_using_post(body_access_token)
13
+
14
+ /tokens/callback
15
+
16
+ ### Example
17
+ ```ruby
18
+ # load the gem
19
+ require 'pier-sdk-ruby'
20
+ # setup authorization
21
+ Pier.configure do |config|
22
+ # Configure API key authorization: access_token
23
+ config.api_key['access_token'] = 'YOUR API KEY'
24
+ # Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
25
+ #config.api_key_prefix['access_token'] = 'BEARER'
26
+ end
27
+
28
+ api_instance = Pier::TokenApi.new
29
+
30
+ body_access_token = Pier::BodyAccessToken.new # BodyAccessToken | bodyAccessToken
31
+
32
+
33
+ begin
34
+ #/tokens/callback
35
+ result = api_instance.callback_using_post(body_access_token)
36
+ p result
37
+ rescue Pier::ApiError => e
38
+ puts "Exception when calling TokenApi->callback_using_post: #{e}"
39
+ end
40
+ ```
41
+
42
+ ### Parameters
43
+
44
+ Name | Type | Description | Notes
45
+ ------------- | ------------- | ------------- | -------------
46
+ **body_access_token** | [**BodyAccessToken**](BodyAccessToken.md)| bodyAccessToken |
47
+
48
+ ### Return type
49
+
50
+ [**BodyAccessToken**](BodyAccessToken.md)
51
+
52
+ ### Authorization
53
+
54
+ [access_token](../README.md#access_token)
55
+
56
+ ### HTTP request headers
57
+
58
+ - **Content-Type**: application/json
59
+ - **Accept**: application/json
60
+
61
+
62
+
63
+ # **validar_using_post**
64
+ > Object validar_using_post(body_access_token)
65
+
66
+ /tokens/validar
67
+
68
+ ### Example
69
+ ```ruby
70
+ # load the gem
71
+ require 'pier-sdk-ruby'
72
+ # setup authorization
73
+ Pier.configure do |config|
74
+ # Configure API key authorization: access_token
75
+ config.api_key['access_token'] = 'YOUR API KEY'
76
+ # Uncomment the following line to set a prefix for the API key, e.g. 'BEARER' (defaults to nil)
77
+ #config.api_key_prefix['access_token'] = 'BEARER'
78
+ end
79
+
80
+ api_instance = Pier::TokenApi.new
81
+
82
+ body_access_token = Pier::BodyAccessToken.new # BodyAccessToken | bodyAccessToken
83
+
84
+
85
+ begin
86
+ #/tokens/validar
87
+ result = api_instance.validar_using_post(body_access_token)
88
+ p result
89
+ rescue Pier::ApiError => e
90
+ puts "Exception when calling TokenApi->validar_using_post: #{e}"
91
+ end
92
+ ```
93
+
94
+ ### Parameters
95
+
96
+ Name | Type | Description | Notes
97
+ ------------- | ------------- | ------------- | -------------
98
+ **body_access_token** | [**BodyAccessToken**](BodyAccessToken.md)| bodyAccessToken |
99
+
100
+ ### Return type
101
+
102
+ **Object**
103
+
104
+ ### Authorization
105
+
106
+ [access_token](../README.md#access_token)
107
+
108
+ ### HTTP request headers
109
+
110
+ - **Content-Type**: application/json
111
+ - **Accept**: application/json
112
+
113
+
114
+
data/git_push.sh ADDED
@@ -0,0 +1,52 @@
1
+ #!/bin/sh
2
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
3
+ #
4
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
5
+
6
+ git_user_id=$1
7
+ git_repo_id=$2
8
+ release_note=$3
9
+
10
+ if [ "$git_user_id" = "" ]; then
11
+ git_user_id=""
12
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
13
+ fi
14
+
15
+ if [ "$git_repo_id" = "" ]; then
16
+ git_repo_id=""
17
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
18
+ fi
19
+
20
+ if [ "$release_note" = "" ]; then
21
+ release_note=""
22
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
23
+ fi
24
+
25
+ # Initialize the local directory as a Git repository
26
+ git init
27
+
28
+ # Adds the files in the local repository and stages them for commit.
29
+ git add .
30
+
31
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
32
+ git commit -m "$release_note"
33
+
34
+ # Sets the new remote
35
+ git_remote=`git remote`
36
+ if [ "$git_remote" = "" ]; then # git remote not defined
37
+
38
+ if [ "$GIT_TOKEN" = "" ]; then
39
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
40
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
41
+ else
42
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
43
+ fi
44
+
45
+ fi
46
+
47
+ git pull origin master
48
+
49
+ # Pushes (Forces) the changes in the local repository up to the remote repository
50
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
51
+ git push origin master 2>&1 | grep -v 'To https'
52
+
@@ -0,0 +1,62 @@
1
+ =begin
2
+ CaaS - Conductor as a Service
3
+
4
+ Gest\u00C3\u00A3o de pagamento eletr\u00C3\u00B4nicos como servi\u00C3\u00A7o
5
+
6
+ OpenAPI spec version: 0.0.1
7
+ Contact: contato@conductor.com.br
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: Apache 2.0
11
+ http://www.apache.org/licenses/LICENSE-2.0.html
12
+
13
+ Terms of Service: http://dev.conductor.com.br/terms/
14
+
15
+ =end
16
+
17
+ # Common files
18
+ require 'pier-sdk-ruby/api_client'
19
+ require 'pier-sdk-ruby/api_error'
20
+ require 'pier-sdk-ruby/version'
21
+ require 'pier-sdk-ruby/configuration'
22
+
23
+ # Models
24
+ require 'pier-sdk-ruby/models/auth_token'
25
+ require 'pier-sdk-ruby/models/body_access_token'
26
+ require 'pier-sdk-ruby/models/cancelar_cartao_response'
27
+ require 'pier-sdk-ruby/models/cartao_response'
28
+ require 'pier-sdk-ruby/models/consultar_cartao_response'
29
+ require 'pier-sdk-ruby/models/consultar_conta_cartao_response'
30
+ require 'pier-sdk-ruby/models/consultar_conta_response'
31
+ require 'pier-sdk-ruby/models/consultar_extrato_conta_response'
32
+ require 'pier-sdk-ruby/models/consultar_saldo_limites_response'
33
+ require 'pier-sdk-ruby/models/conta_cartao_response'
34
+ require 'pier-sdk-ruby/models/conta_response'
35
+ require 'pier-sdk-ruby/models/desbloquear_cartao_response'
36
+ require 'pier-sdk-ruby/models/extra_info'
37
+ require 'pier-sdk-ruby/models/extrato_response'
38
+ require 'pier-sdk-ruby/models/pessoa_fisica_response'
39
+ require 'pier-sdk-ruby/models/saldo_limite_response'
40
+
41
+ # APIs
42
+ require 'pier-sdk-ruby/api/cartao_api'
43
+ require 'pier-sdk-ruby/api/conta_api'
44
+ require 'pier-sdk-ruby/api/token_api'
45
+
46
+ module Pier
47
+ class << self
48
+ # Customize default settings for the SDK using block.
49
+ # Pier.configure do |config|
50
+ # config.username = "xxx"
51
+ # config.password = "xxx"
52
+ # end
53
+ # If no block given, return the default Configuration object.
54
+ def configure
55
+ if block_given?
56
+ yield(Configuration.default)
57
+ else
58
+ Configuration.default
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,355 @@
1
+ =begin
2
+ CaaS - Conductor as a Service
3
+
4
+ Gest\u00C3\u00A3o de pagamento eletr\u00C3\u00B4nicos como servi\u00C3\u00A7o
5
+
6
+ OpenAPI spec version: 0.0.1
7
+ Contact: contato@conductor.com.br
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: Apache 2.0
11
+ http://www.apache.org/licenses/LICENSE-2.0.html
12
+
13
+ Terms of Service: http://dev.conductor.com.br/terms/
14
+
15
+ =end
16
+
17
+ require "uri"
18
+
19
+ module Pier
20
+ class CartaoApi
21
+ attr_accessor :api_client
22
+
23
+ def initialize(api_client = ApiClient.default)
24
+ @api_client = api_client
25
+ end
26
+
27
+ # /contas/{idConta}/cartoes/{idCartao}/bloquear
28
+ # Bloquear um determinado cart\u00C3\u00A3o
29
+ # @param id_conta ID da Conta
30
+ # @param id_cartao ID do Cart\u00C3\u00A3o que deseja cancelar
31
+ # @param motivo Motivo do bloqueio
32
+ # @param [Hash] opts the optional parameters
33
+ # @option opts [String] :observacao Alguma observa\u00C3\u00A7\u00C3\u00A3o para o bloqueio
34
+ # @return [CancelarCartaoResponse]
35
+ def bloquear_cartao_using_post(id_conta, id_cartao, motivo, opts = {})
36
+ data, _status_code, _headers = bloquear_cartao_using_post_with_http_info(id_conta, id_cartao, motivo, opts)
37
+ return data
38
+ end
39
+
40
+ # /contas/{idConta}/cartoes/{idCartao}/bloquear
41
+ # Bloquear um determinado cart\u00C3\u00A3o
42
+ # @param id_conta ID da Conta
43
+ # @param id_cartao ID do Cart\u00C3\u00A3o que deseja cancelar
44
+ # @param motivo Motivo do bloqueio
45
+ # @param [Hash] opts the optional parameters
46
+ # @option opts [String] :observacao Alguma observa\u00C3\u00A7\u00C3\u00A3o para o bloqueio
47
+ # @return [Array<(CancelarCartaoResponse, Fixnum, Hash)>] CancelarCartaoResponse data, response status code and response headers
48
+ def bloquear_cartao_using_post_with_http_info(id_conta, id_cartao, motivo, opts = {})
49
+ if @api_client.config.debugging
50
+ @api_client.config.logger.debug "Calling API: CartaoApi.bloquear_cartao_using_post ..."
51
+ end
52
+
53
+
54
+ # verify the required parameter 'id_conta' is set
55
+ fail ArgumentError, "Missing the required parameter 'id_conta' when calling CartaoApi.bloquear_cartao_using_post" if id_conta.nil?
56
+
57
+
58
+
59
+
60
+
61
+
62
+ # verify the required parameter 'id_cartao' is set
63
+ fail ArgumentError, "Missing the required parameter 'id_cartao' when calling CartaoApi.bloquear_cartao_using_post" if id_cartao.nil?
64
+
65
+
66
+
67
+
68
+
69
+
70
+ # verify the required parameter 'motivo' is set
71
+ fail ArgumentError, "Missing the required parameter 'motivo' when calling CartaoApi.bloquear_cartao_using_post" if motivo.nil?
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+ # resource path
84
+ local_var_path = "/v1/contas/{idConta}/cartoes/{idCartao}/bloquear".sub('{format}','json').sub('{' + 'idConta' + '}', id_conta.to_s).sub('{' + 'idCartao' + '}', id_cartao.to_s)
85
+
86
+ # query parameters
87
+ query_params = {}
88
+ query_params[:'motivo'] = motivo
89
+ query_params[:'observacao'] = opts[:'observacao'] if opts[:'observacao']
90
+
91
+ # header parameters
92
+ header_params = {}
93
+
94
+ # HTTP header 'Accept' (if needed)
95
+ local_header_accept = ['application/json']
96
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
97
+
98
+ # HTTP header 'Content-Type'
99
+ local_header_content_type = ['application/json']
100
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
101
+
102
+ # form parameters
103
+ form_params = {}
104
+
105
+ # http body (model)
106
+ post_body = nil
107
+
108
+ auth_names = ['access_token']
109
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
110
+ :header_params => header_params,
111
+ :query_params => query_params,
112
+ :form_params => form_params,
113
+ :body => post_body,
114
+ :auth_names => auth_names,
115
+ :return_type => 'CancelarCartaoResponse')
116
+ if @api_client.config.debugging
117
+ @api_client.config.logger.debug "API called: CartaoApi#bloquear_cartao_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
118
+ end
119
+ return data, status_code, headers
120
+ end
121
+
122
+ # /contas/{idConta}/cartoes/{idCartao}
123
+ # Consultar as informa\u00C3\u00A7\u00C3\u00B5es de um determinado cart\u00C3\u00A3o de uma conta
124
+ # @param id_conta ID da Conta que pertence o cart\u00C3\u00A3o
125
+ # @param id_cartao ID do Cart\u00C3\u00A3o que deseja consultar
126
+ # @param [Hash] opts the optional parameters
127
+ # @option opts [String] :numero_cartao N\u00C3\u00BAmero do Cart\u00C3\u00A3o que deseja consultar (opcional)
128
+ # @return [ConsultarCartaoResponse]
129
+ def consultar_cartao_using_get(id_conta, id_cartao, opts = {})
130
+ data, _status_code, _headers = consultar_cartao_using_get_with_http_info(id_conta, id_cartao, opts)
131
+ return data
132
+ end
133
+
134
+ # /contas/{idConta}/cartoes/{idCartao}
135
+ # Consultar as informa\u00C3\u00A7\u00C3\u00B5es de um determinado cart\u00C3\u00A3o de uma conta
136
+ # @param id_conta ID da Conta que pertence o cart\u00C3\u00A3o
137
+ # @param id_cartao ID do Cart\u00C3\u00A3o que deseja consultar
138
+ # @param [Hash] opts the optional parameters
139
+ # @option opts [String] :numero_cartao N\u00C3\u00BAmero do Cart\u00C3\u00A3o que deseja consultar (opcional)
140
+ # @return [Array<(ConsultarCartaoResponse, Fixnum, Hash)>] ConsultarCartaoResponse data, response status code and response headers
141
+ def consultar_cartao_using_get_with_http_info(id_conta, id_cartao, opts = {})
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug "Calling API: CartaoApi.consultar_cartao_using_get ..."
144
+ end
145
+
146
+
147
+ # verify the required parameter 'id_conta' is set
148
+ fail ArgumentError, "Missing the required parameter 'id_conta' when calling CartaoApi.consultar_cartao_using_get" if id_conta.nil?
149
+
150
+
151
+
152
+
153
+
154
+
155
+ # verify the required parameter 'id_cartao' is set
156
+ fail ArgumentError, "Missing the required parameter 'id_cartao' when calling CartaoApi.consultar_cartao_using_get" if id_cartao.nil?
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ # resource path
169
+ local_var_path = "/v1/contas/{idConta}/cartoes/{idCartao}".sub('{format}','json').sub('{' + 'idConta' + '}', id_conta.to_s).sub('{' + 'idCartao' + '}', id_cartao.to_s)
170
+
171
+ # query parameters
172
+ query_params = {}
173
+
174
+ # header parameters
175
+ header_params = {}
176
+
177
+ # HTTP header 'Accept' (if needed)
178
+ local_header_accept = ['application/json']
179
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
180
+
181
+ # HTTP header 'Content-Type'
182
+ local_header_content_type = ['application/json']
183
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
184
+ header_params[:'numeroCartao'] = opts[:'numero_cartao'] if opts[:'numero_cartao']
185
+
186
+ # form parameters
187
+ form_params = {}
188
+
189
+ # http body (model)
190
+ post_body = nil
191
+
192
+ auth_names = ['access_token']
193
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
194
+ :header_params => header_params,
195
+ :query_params => query_params,
196
+ :form_params => form_params,
197
+ :body => post_body,
198
+ :auth_names => auth_names,
199
+ :return_type => 'ConsultarCartaoResponse')
200
+ if @api_client.config.debugging
201
+ @api_client.config.logger.debug "API called: CartaoApi#consultar_cartao_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
202
+ end
203
+ return data, status_code, headers
204
+ end
205
+
206
+ # /contas/{idConta}/cartoes
207
+ # Consultar todos os cart\u00C3\u00B5es de uma determinada conta
208
+ # @param id_conta ID da Conta
209
+ # @param [Hash] opts the optional parameters
210
+ # @return [ConsultarCartaoResponse]
211
+ def consultar_cartoes_using_get(id_conta, opts = {})
212
+ data, _status_code, _headers = consultar_cartoes_using_get_with_http_info(id_conta, opts)
213
+ return data
214
+ end
215
+
216
+ # /contas/{idConta}/cartoes
217
+ # Consultar todos os cart\u00C3\u00B5es de uma determinada conta
218
+ # @param id_conta ID da Conta
219
+ # @param [Hash] opts the optional parameters
220
+ # @return [Array<(ConsultarCartaoResponse, Fixnum, Hash)>] ConsultarCartaoResponse data, response status code and response headers
221
+ def consultar_cartoes_using_get_with_http_info(id_conta, opts = {})
222
+ if @api_client.config.debugging
223
+ @api_client.config.logger.debug "Calling API: CartaoApi.consultar_cartoes_using_get ..."
224
+ end
225
+
226
+
227
+ # verify the required parameter 'id_conta' is set
228
+ fail ArgumentError, "Missing the required parameter 'id_conta' when calling CartaoApi.consultar_cartoes_using_get" if id_conta.nil?
229
+
230
+
231
+
232
+
233
+
234
+ # resource path
235
+ local_var_path = "/v1/contas/{idConta}/cartoes".sub('{format}','json').sub('{' + 'idConta' + '}', id_conta.to_s)
236
+
237
+ # query parameters
238
+ query_params = {}
239
+
240
+ # header parameters
241
+ header_params = {}
242
+
243
+ # HTTP header 'Accept' (if needed)
244
+ local_header_accept = ['application/json']
245
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
246
+
247
+ # HTTP header 'Content-Type'
248
+ local_header_content_type = ['application/json']
249
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
250
+
251
+ # form parameters
252
+ form_params = {}
253
+
254
+ # http body (model)
255
+ post_body = nil
256
+
257
+ auth_names = ['access_token']
258
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
259
+ :header_params => header_params,
260
+ :query_params => query_params,
261
+ :form_params => form_params,
262
+ :body => post_body,
263
+ :auth_names => auth_names,
264
+ :return_type => 'ConsultarCartaoResponse')
265
+ if @api_client.config.debugging
266
+ @api_client.config.logger.debug "API called: CartaoApi#consultar_cartoes_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
267
+ end
268
+ return data, status_code, headers
269
+ end
270
+
271
+ # /contas/{idConta}/cartoes/{idCartao}/desbloquear
272
+ # Desbloquear cart\u00C3\u00A3o de uma determinada conta
273
+ # @param id_conta ID da Conta
274
+ # @param id_cartao ID do Cart\u00C3\u00A3o que deseja consultar o saldo/limite
275
+ # @param [Hash] opts the optional parameters
276
+ # @option opts [String] :codigo_segurancao C\u00C3\u00B3digo seguran\u00C3\u00A7a do cart\u00C3\u00A3o
277
+ # @return [DesbloquearCartaoResponse]
278
+ def desbloquear_cartao_using_post(id_conta, id_cartao, opts = {})
279
+ data, _status_code, _headers = desbloquear_cartao_using_post_with_http_info(id_conta, id_cartao, opts)
280
+ return data
281
+ end
282
+
283
+ # /contas/{idConta}/cartoes/{idCartao}/desbloquear
284
+ # Desbloquear cart\u00C3\u00A3o de uma determinada conta
285
+ # @param id_conta ID da Conta
286
+ # @param id_cartao ID do Cart\u00C3\u00A3o que deseja consultar o saldo/limite
287
+ # @param [Hash] opts the optional parameters
288
+ # @option opts [String] :codigo_segurancao C\u00C3\u00B3digo seguran\u00C3\u00A7a do cart\u00C3\u00A3o
289
+ # @return [Array<(DesbloquearCartaoResponse, Fixnum, Hash)>] DesbloquearCartaoResponse data, response status code and response headers
290
+ def desbloquear_cartao_using_post_with_http_info(id_conta, id_cartao, opts = {})
291
+ if @api_client.config.debugging
292
+ @api_client.config.logger.debug "Calling API: CartaoApi.desbloquear_cartao_using_post ..."
293
+ end
294
+
295
+
296
+ # verify the required parameter 'id_conta' is set
297
+ fail ArgumentError, "Missing the required parameter 'id_conta' when calling CartaoApi.desbloquear_cartao_using_post" if id_conta.nil?
298
+
299
+
300
+
301
+
302
+
303
+
304
+ # verify the required parameter 'id_cartao' is set
305
+ fail ArgumentError, "Missing the required parameter 'id_cartao' when calling CartaoApi.desbloquear_cartao_using_post" if id_cartao.nil?
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+ # resource path
318
+ local_var_path = "/v1/contas/{idConta}/cartoes/{idCartao}/desbloquear".sub('{format}','json').sub('{' + 'idConta' + '}', id_conta.to_s).sub('{' + 'idCartao' + '}', id_cartao.to_s)
319
+
320
+ # query parameters
321
+ query_params = {}
322
+
323
+ # header parameters
324
+ header_params = {}
325
+
326
+ # HTTP header 'Accept' (if needed)
327
+ local_header_accept = ['application/json']
328
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
329
+
330
+ # HTTP header 'Content-Type'
331
+ local_header_content_type = ['application/json']
332
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
333
+ header_params[:'codigoSegurancao'] = opts[:'codigo_segurancao'] if opts[:'codigo_segurancao']
334
+
335
+ # form parameters
336
+ form_params = {}
337
+
338
+ # http body (model)
339
+ post_body = nil
340
+
341
+ auth_names = ['access_token']
342
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
343
+ :header_params => header_params,
344
+ :query_params => query_params,
345
+ :form_params => form_params,
346
+ :body => post_body,
347
+ :auth_names => auth_names,
348
+ :return_type => 'DesbloquearCartaoResponse')
349
+ if @api_client.config.debugging
350
+ @api_client.config.logger.debug "API called: CartaoApi#desbloquear_cartao_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
351
+ end
352
+ return data, status_code, headers
353
+ end
354
+ end
355
+ end