Class: LinodeOpenapiClient::BetaProgramsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/linode_openapi_client/api/beta_programs_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BetaProgramsApi

Returns a new instance of BetaProgramsApi.



19
20
21
# File 'lib/linode_openapi_client/api/beta_programs_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/linode_openapi_client/api/beta_programs_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_beta_program(api_version, beta_id, opts = {}) ⇒ GetBetaProgram200Response

Get a Beta program Display information about a Beta Program. This operation can be used to access inactive as well as active Beta Programs. Only unrestricted Users can access this operation. <<LB>> — - __CLI__. “‘ linode-cli beta view $betaId “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • beta_id (String)

    The ID of the Beta Program.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/linode_openapi_client/api/beta_programs_api.rb', line 28

def get_beta_program(api_version, beta_id, opts = {})
  data, _status_code, _headers = get_beta_program_with_http_info(api_version, beta_id, opts)
  data
end

#get_beta_program_with_http_info(api_version, beta_id, opts = {}) ⇒ Array<(GetBetaProgram200Response, Integer, Hash)>

Get a Beta program Display information about a Beta Program. This operation can be used to access inactive as well as active Beta Programs. Only unrestricted Users can access this operation. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli beta view $betaId &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • beta_id (String)

    The ID of the Beta Program.

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

    the optional parameters

Returns:

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

    GetBetaProgram200Response data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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
# File 'lib/linode_openapi_client/api/beta_programs_api.rb', line 39

def get_beta_program_with_http_info(api_version, beta_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BetaProgramsApi.get_beta_program ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling BetaProgramsApi.get_beta_program"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'beta_id' is set
  if @api_client.config.client_side_validation && beta_id.nil?
    fail ArgumentError, "Missing the required parameter 'beta_id' when calling BetaProgramsApi.get_beta_program"
  end
  # resource path
  local_var_path = '/{apiVersion}/betas/{betaId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'betaId' + '}', CGI.escape(beta_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] || 'GetBetaProgram200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"BetaProgramsApi.get_beta_program",
    :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: BetaProgramsApi#get_beta_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_beta_programs(api_version, opts = {}) ⇒ GetBetaPrograms200Response

List Beta programs Display all active Beta Programs. Only unrestricted Users can access this operation. <<LB>> — - __CLI__. “‘ linode-cli betas list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



103
104
105
106
# File 'lib/linode_openapi_client/api/beta_programs_api.rb', line 103

def get_beta_programs(api_version, opts = {})
  data, _status_code, _headers = get_beta_programs_with_http_info(api_version, opts)
  data
end

#get_beta_programs_with_http_info(api_version, opts = {}) ⇒ Array<(GetBetaPrograms200Response, Integer, Hash)>

List Beta programs Display all active Beta Programs. Only unrestricted Users can access this operation. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli betas list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:

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

    GetBetaPrograms200Response data, response status code and response headers



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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
# File 'lib/linode_openapi_client/api/beta_programs_api.rb', line 115

def get_beta_programs_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BetaProgramsApi.get_beta_programs ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling BetaProgramsApi.get_beta_programs"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling BetaProgramsApi.get_beta_programs, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling BetaProgramsApi.get_beta_programs, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 25
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling BetaProgramsApi.get_beta_programs, must be greater than or equal to 25.'
  end

  # resource path
  local_var_path = '/{apiVersion}/betas'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].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] || 'GetBetaPrograms200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"BetaProgramsApi.get_beta_programs",
    :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: BetaProgramsApi#get_beta_programs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end