Class: IntersightClient::FeedbackApi

Inherits:
Object
  • Object
show all
Defined in:
lib/intersight_client/api/feedback_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FeedbackApi

Returns a new instance of FeedbackApi.



19
20
21
# File 'lib/intersight_client/api/feedback_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/intersight_client/api/feedback_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_feedback_feedback_post(feedback_feedback_post, opts = {}) ⇒ FeedbackFeedbackPost

Create a ‘feedback.FeedbackPost’ resource.

Parameters:

  • feedback_feedback_post (FeedbackFeedbackPost)

    The 'feedback.FeedbackPost' resource to create.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For methods that apply server-side changes, and in particular for PUT, If-Match can be used to prevent the lost update problem. It can check if the modification of a resource that the user wants to upload will not override another change that has been done since the original resource was fetched. If the request cannot be fulfilled, the 412 (Precondition Failed) response is returned. When modifying a resource using POST or PUT, the If-Match header must be set to the value of the resource ModTime property after which no lost update problem should occur. For example, a client send a GET request to obtain a resource, which includes the ModTime property. The ModTime indicates the last time the resource was created or modified. The client then sends a POST or PUT request with the If-Match header set to the ModTime property of the resource as obtained in the GET request.

  • :if_none_match (String)

    For methods that apply server-side changes, If-None-Match used with the * value can be used to create a resource not known to exist, guaranteeing that another resource creation didn't happen before, losing the data of the previous put. The request will be processed only if the eventually existing resource's ETag doesn't match any of the values listed. Otherwise, the status code 412 (Precondition Failed) is used. The asterisk is a special value representing any resource. It is only useful when creating a resource, usually with PUT, to check if another resource with the identity has already been created before. The comparison with the stored ETag uses the weak comparison algorithm, meaning two resources are considered identical if the content is equivalent - they don't have to be identical byte for byte.

Returns:



28
29
30
31
# File 'lib/intersight_client/api/feedback_api.rb', line 28

def create_feedback_feedback_post(feedback_feedback_post, opts = {})
  data, _status_code, _headers = create_feedback_feedback_post_with_http_info(feedback_feedback_post, opts)
  data
end

#create_feedback_feedback_post_with_http_info(feedback_feedback_post, opts = {}) ⇒ Array<(FeedbackFeedbackPost, Integer, Hash)>

Create a &#39;feedback.FeedbackPost&#39; resource.

Parameters:

  • feedback_feedback_post (FeedbackFeedbackPost)

    The &#39;feedback.FeedbackPost&#39; resource to create.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For methods that apply server-side changes, and in particular for PUT, If-Match can be used to prevent the lost update problem. It can check if the modification of a resource that the user wants to upload will not override another change that has been done since the original resource was fetched. If the request cannot be fulfilled, the 412 (Precondition Failed) response is returned. When modifying a resource using POST or PUT, the If-Match header must be set to the value of the resource ModTime property after which no lost update problem should occur. For example, a client send a GET request to obtain a resource, which includes the ModTime property. The ModTime indicates the last time the resource was created or modified. The client then sends a POST or PUT request with the If-Match header set to the ModTime property of the resource as obtained in the GET request.

  • :if_none_match (String)

    For methods that apply server-side changes, If-None-Match used with the * value can be used to create a resource not known to exist, guaranteeing that another resource creation didn&#39;t happen before, losing the data of the previous put. The request will be processed only if the eventually existing resource&#39;s ETag doesn&#39;t match any of the values listed. Otherwise, the status code 412 (Precondition Failed) is used. The asterisk is a special value representing any resource. It is only useful when creating a resource, usually with PUT, to check if another resource with the identity has already been created before. The comparison with the stored ETag uses the weak comparison algorithm, meaning two resources are considered identical if the content is equivalent - they don&#39;t have to be identical byte for byte.

Returns:

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

    FeedbackFeedbackPost 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
# File 'lib/intersight_client/api/feedback_api.rb', line 39

def create_feedback_feedback_post_with_http_info(feedback_feedback_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FeedbackApi.create_feedback_feedback_post ...'
  end
  # verify the required parameter 'feedback_feedback_post' is set
  if @api_client.config.client_side_validation && feedback_feedback_post.nil?
    fail ArgumentError, "Missing the required parameter 'feedback_feedback_post' when calling FeedbackApi.create_feedback_feedback_post"
  end
  # resource path
  local_var_path = '/api/v1/feedback/FeedbackPosts'

  # 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'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
  header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(feedback_feedback_post)

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']

  new_options = opts.merge(
    :operation => :"FeedbackApi.create_feedback_feedback_post",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FeedbackApi#create_feedback_feedback_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end