Class: Invoicetronic_Sdk::UpdateApi

Inherits:
Object
  • Object
show all
Defined in:
lib/invoicetronic_sdk/api/update_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ UpdateApi

Returns a new instance of UpdateApi.



19
20
21
# File 'lib/invoicetronic_sdk/api/update_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/invoicetronic_sdk/api/update_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#update_get(opts = {}) ⇒ Array<Update>

List updates Retrieve a paginated list of updates. Results can be filtered by various criteria such as company, send item, SDI state, and date ranges. Updates are status notifications from Italy’s SDI (Sistema di Interscambio) about invoices you sent. Multiple updates can exist for the same send item as the invoice progresses through the SDI workflow. The ‘state` field is the most important property and can have the following values: | Value | Name | Description | |——-|——|————-| | 2 | `Inviato` | Sent to the SDI. | | 5 | `Consegnato` | Delivered to the recipient. | | 6 | `NonConsegnato` | Not delivered to the recipient. Only relevant for public administration entities. | | 7 | `Scartato` | Rejected by the SDI. | | 8 | `AccettatoDalDestinatario` | Accepted by the recipient. Only relevant for public administration entities. | | 9 | `RifiutatoDalDestinatario` | Rejected by the recipient. Only relevant for public administration entities. | | 10 | `ImpossibilitaDiRecapito` | Available on the recipient’s tax drawer, but it was not possible to deliver it to the recipient’s reception system. | | 11 | ‘DecorrenzaTermini` | A public administration entity has not responded for more than 15 days. The document is considered delivered. | | 12 | `AttestazioneTrasmissioneFattura` | A public administration entity has received the document, but has not yet processed it. | Cost: Querying this endpoint is free and does not count as an operation against your plan limits. Important: Always monitor the state of your sent invoices. A state of `Inviato` only means the invoice has been submitted to SDI, not that it has been delivered. A state like `Scartato` indicates that the invoice was not successfully delivered and may require corrective action, such as fixing validation errors and resubmitting. In that case, `description` contains the reason for the rejection.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :company_id (Integer)

    Company id

  • :identifier (String)

    SDI identifier.

  • :prestatore (String)

    Vat number or fiscal code.

  • :unread (Boolean)

    Unread items only.

  • :send_id (Integer)

    Send item&#39;s id.

  • :state (String)

    SDI state

  • :last_update_from (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :last_update_to (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :date_sent_from (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :date_sent_to (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :page (Integer)

    Page number. (default to 1)

  • :page_size (Integer)

    Items per page. Cannot be greater than 200. (default to 100)

  • :sort (String)

    Sort by field. Prefix with &#39;-&#39; for descending order. (default to ‘last_update’)

Returns:



39
40
41
42
# File 'lib/invoicetronic_sdk/api/update_api.rb', line 39

def update_get(opts = {})
  data, _status_code, _headers = update_get_with_http_info(opts)
  data
end

#update_get_with_http_info(opts = {}) ⇒ Array<(Array<Update>, Integer, Hash)>

List updates Retrieve a paginated list of updates. Results can be filtered by various criteria such as company, send item, SDI state, and date ranges. Updates are status notifications from Italy&#39;s SDI (Sistema di Interscambio) about invoices you sent. Multiple updates can exist for the same send item as the invoice progresses through the SDI workflow. The &#x60;state&#x60; field is the most important property and can have the following values: | Value | Name | Description | |——-|——|————-| | 2 | &#x60;Inviato&#x60; | Sent to the SDI. | | 5 | &#x60;Consegnato&#x60; | Delivered to the recipient. | | 6 | &#x60;NonConsegnato&#x60; | Not delivered to the recipient. Only relevant for public administration entities. | | 7 | &#x60;Scartato&#x60; | Rejected by the SDI. | | 8 | &#x60;AccettatoDalDestinatario&#x60; | Accepted by the recipient. Only relevant for public administration entities. | | 9 | &#x60;RifiutatoDalDestinatario&#x60; | Rejected by the recipient. Only relevant for public administration entities. | | 10 | &#x60;ImpossibilitaDiRecapito&#x60; | Available on the recipient&#39;s tax drawer, but it was not possible to deliver it to the recipient&#39;s reception system. | | 11 | &#x60;DecorrenzaTermini&#x60; | A public administration entity has not responded for more than 15 days. The document is considered delivered. | | 12 | &#x60;AttestazioneTrasmissioneFattura&#x60; | A public administration entity has received the document, but has not yet processed it. | Cost: Querying this endpoint is free and does not count as an operation against your plan limits. Important: Always monitor the state of your sent invoices. A state of &#x60;Inviato&#x60; only means the invoice has been submitted to SDI, not that it has been delivered. A state like &#x60;Scartato&#x60; indicates that the invoice was not successfully delivered and may require corrective action, such as fixing validation errors and resubmitting. In that case, &#x60;description&#x60; contains the reason for the rejection.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :company_id (Integer)

    Company id

  • :identifier (String)

    SDI identifier.

  • :prestatore (String)

    Vat number or fiscal code.

  • :unread (Boolean)

    Unread items only.

  • :send_id (Integer)

    Send item&#39;s id.

  • :state (String)

    SDI state

  • :last_update_from (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :last_update_to (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :date_sent_from (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :date_sent_to (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :page (Integer)

    Page number. (default to 1)

  • :page_size (Integer)

    Items per page. Cannot be greater than 200. (default to 100)

  • :sort (String)

    Sort by field. Prefix with &#39;-&#39; for descending order. (default to ‘last_update’)

Returns:

  • (Array<(Array<Update>, Integer, Hash)>)

    Array<Update> data, response status code and response headers



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/invoicetronic_sdk/api/update_api.rb', line 61

def update_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UpdateApi.update_get ...'
  end
  allowable_values = ["Inviato", "Consegnato", "NonConsegnato", "Scartato", "AccettatoDalDestinatario", "RifiutatoDalDestinatario", "ImpossibilitaDiRecapito", "DecorrenzaTermini", "AttestazioneTrasmissioneFattura"]
  if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
    fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/update'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'company_id'] = opts[:'company_id'] if !opts[:'company_id'].nil?
  query_params[:'identifier'] = opts[:'identifier'] if !opts[:'identifier'].nil?
  query_params[:'prestatore'] = opts[:'prestatore'] if !opts[:'prestatore'].nil?
  query_params[:'unread'] = opts[:'unread'] if !opts[:'unread'].nil?
  query_params[:'send_id'] = opts[:'send_id'] if !opts[:'send_id'].nil?
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
  query_params[:'last_update_from'] = opts[:'last_update_from'] if !opts[:'last_update_from'].nil?
  query_params[:'last_update_to'] = opts[:'last_update_to'] if !opts[:'last_update_to'].nil?
  query_params[:'date_sent_from'] = opts[:'date_sent_from'] if !opts[:'date_sent_from'].nil?
  query_params[:'date_sent_to'] = opts[:'date_sent_to'] if !opts[:'date_sent_to'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Update>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic']

  new_options = opts.merge(
    :operation => :"UpdateApi.update_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UpdateApi#update_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_id_get(id, opts = {}) ⇒ Update

Get an update by id Retrieve an update by its internal id. Updates are status notifications from Italy’s SDI (Sistema di Interscambio) about invoices you sent. Multiple updates can exist for the same send item as the invoice progresses through the SDI workflow. The ‘state` field is the most important property and can have the following values: | Value | Name | Description | |——-|——|————-| | 2 | `Inviato` | Sent to the SDI. | | 5 | `Consegnato` | Delivered to the recipient. | | 6 | `NonConsegnato` | Not delivered to the recipient. Only relevant for public administration entities. | | 7 | `Scartato` | Rejected by the SDI. | | 8 | `AccettatoDalDestinatario` | Accepted by the recipient. Only relevant for public administration entities. | | 9 | `RifiutatoDalDestinatario` | Rejected by the recipient. Only relevant for public administration entities. | | 10 | `ImpossibilitaDiRecapito` | Available on the recipient’s tax drawer, but it was not possible to deliver it to the recipient’s reception system. | | 11 | ‘DecorrenzaTermini` | A public administration entity has not responded for more than 15 days. The document is considered delivered. | | 12 | `AttestazioneTrasmissioneFattura` | A public administration entity has received the document, but has not yet processed it. | Cost: Querying this endpoint is free and does not count as an operation against your plan limits. Important: Always monitor the state of your sent invoices. A state of `Inviato` only means the invoice has been submitted to SDI, not that it has been delivered. A state like `Scartato` indicates that the invoice was not successfully delivered and may require corrective action, such as fixing validation errors and resubmitting. In that case, `description` contains the reason for the rejection.

Parameters:

  • id (Integer)

    Item id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



127
128
129
130
# File 'lib/invoicetronic_sdk/api/update_api.rb', line 127

def update_id_get(id, opts = {})
  data, _status_code, _headers = update_id_get_with_http_info(id, opts)
  data
end

#update_id_get_with_http_info(id, opts = {}) ⇒ Array<(Update, Integer, Hash)>

Get an update by id Retrieve an update by its internal id. Updates are status notifications from Italy&#39;s SDI (Sistema di Interscambio) about invoices you sent. Multiple updates can exist for the same send item as the invoice progresses through the SDI workflow. The &#x60;state&#x60; field is the most important property and can have the following values: | Value | Name | Description | |——-|——|————-| | 2 | &#x60;Inviato&#x60; | Sent to the SDI. | | 5 | &#x60;Consegnato&#x60; | Delivered to the recipient. | | 6 | &#x60;NonConsegnato&#x60; | Not delivered to the recipient. Only relevant for public administration entities. | | 7 | &#x60;Scartato&#x60; | Rejected by the SDI. | | 8 | &#x60;AccettatoDalDestinatario&#x60; | Accepted by the recipient. Only relevant for public administration entities. | | 9 | &#x60;RifiutatoDalDestinatario&#x60; | Rejected by the recipient. Only relevant for public administration entities. | | 10 | &#x60;ImpossibilitaDiRecapito&#x60; | Available on the recipient&#39;s tax drawer, but it was not possible to deliver it to the recipient&#39;s reception system. | | 11 | &#x60;DecorrenzaTermini&#x60; | A public administration entity has not responded for more than 15 days. The document is considered delivered. | | 12 | &#x60;AttestazioneTrasmissioneFattura&#x60; | A public administration entity has received the document, but has not yet processed it. | Cost: Querying this endpoint is free and does not count as an operation against your plan limits. Important: Always monitor the state of your sent invoices. A state of &#x60;Inviato&#x60; only means the invoice has been submitted to SDI, not that it has been delivered. A state like &#x60;Scartato&#x60; indicates that the invoice was not successfully delivered and may require corrective action, such as fixing validation errors and resubmitting. In that case, &#x60;description&#x60; contains the reason for the rejection.

Parameters:

  • id (Integer)

    Item id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Update, Integer, Hash)>)

    Update data, response status code and response headers



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/invoicetronic_sdk/api/update_api.rb', line 137

def update_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UpdateApi.update_id_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling UpdateApi.update_id_get"
  end
  # resource path
  local_var_path = '/update/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Update'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic']

  new_options = opts.merge(
    :operation => :"UpdateApi.update_id_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UpdateApi#update_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end