=begin #Cloudsmith API (v1) #The API to the Cloudsmith Service OpenAPI spec version: v1 Contact: support@cloudsmith.io Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.26 =end require 'uri' module CloudsmithApi class AuditLogApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Lists audit log entries for a specific namespace. # Lists audit log entries for a specific namespace. # @param owner # @param [Hash] opts the optional parameters # @option opts [Integer] :page A page number within the paginated result set. # @option opts [Integer] :page_size Number of results to return per page. # @option opts [String] :query A search term for querying events, actors, or timestamps of log records. # @return [Array] def audit_log_namespace_list(owner, opts = {}) data, _status_code, _headers = audit_log_namespace_list_with_http_info(owner, opts) data end # Lists audit log entries for a specific namespace. # Lists audit log entries for a specific namespace. # @param owner # @param [Hash] opts the optional parameters # @option opts [Integer] :page A page number within the paginated result set. # @option opts [Integer] :page_size Number of results to return per page. # @option opts [String] :query A search term for querying events, actors, or timestamps of log records. # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def audit_log_namespace_list_with_http_info(owner, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuditLogApi.audit_log_namespace_list ...' end # verify the required parameter 'owner' is set if @api_client.config.client_side_validation && owner.nil? fail ArgumentError, "Missing the required parameter 'owner' when calling AuditLogApi.audit_log_namespace_list" end # resource path local_var_path = '/audit-log/{owner}/'.sub('{' + 'owner' + '}', owner.to_s) # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apikey', 'basic', 'token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: AuditLogApi#audit_log_namespace_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lists audit log entries for a specific repository. # Lists audit log entries for a specific repository. # @param owner # @param repo # @param [Hash] opts the optional parameters # @option opts [Integer] :page A page number within the paginated result set. # @option opts [Integer] :page_size Number of results to return per page. # @option opts [String] :query A search term for querying events, actors, or timestamps of log records. # @return [Array] def audit_log_repo_list(owner, repo, opts = {}) data, _status_code, _headers = audit_log_repo_list_with_http_info(owner, repo, opts) data end # Lists audit log entries for a specific repository. # Lists audit log entries for a specific repository. # @param owner # @param repo # @param [Hash] opts the optional parameters # @option opts [Integer] :page A page number within the paginated result set. # @option opts [Integer] :page_size Number of results to return per page. # @option opts [String] :query A search term for querying events, actors, or timestamps of log records. # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def audit_log_repo_list_with_http_info(owner, repo, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuditLogApi.audit_log_repo_list ...' end # verify the required parameter 'owner' is set if @api_client.config.client_side_validation && owner.nil? fail ArgumentError, "Missing the required parameter 'owner' when calling AuditLogApi.audit_log_repo_list" end # verify the required parameter 'repo' is set if @api_client.config.client_side_validation && repo.nil? fail ArgumentError, "Missing the required parameter 'repo' when calling AuditLogApi.audit_log_repo_list" end # resource path local_var_path = '/audit-log/{owner}/{repo}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s) # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apikey', 'basic', 'token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: AuditLogApi#audit_log_repo_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end