Class: Openlayer::Resources::Projects::Tests

Inherits:
Object
  • Object
show all
Defined in:
lib/openlayer/resources/projects/tests.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Tests

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Tests.

Parameters:



129
130
131
# File 'lib/openlayer/resources/projects/tests.rb', line 129

def initialize(client:)
  @client = client
end

Instance Method Details

#create(project_id, description: , name: , subtype: , thresholds: , type: , archived: nil, delay_window: nil, evaluation_window: nil, uses_ml_model: nil, uses_production_data: nil, uses_reference_dataset: nil, uses_training_dataset: nil, uses_validation_dataset: nil, request_options: {}) ⇒ Openlayer::Models::Projects::TestCreateResponse

Some parameter documentations has been truncated, see Models::Projects::TestCreateParams for more details.

Create a test.

Parameters:

  • project_id (String)

    The project id.

  • description (Object, nil)

    The test description.

  • name (String)

    The test name.

  • subtype (Symbol, Openlayer::Models::Projects::TestCreateParams::Subtype)

    The test subtype.

  • thresholds (Array<Openlayer::Models::Projects::TestCreateParams::Threshold>)
  • type (Symbol, Openlayer::Models::Projects::TestCreateParams::Type)

    The test type.

  • archived (Boolean)

    Whether the test is archived.

  • delay_window (Float, nil)

    The delay window in seconds. Only applies to tests that use production data.

  • evaluation_window (Float, nil)

    The evaluation window in seconds. Only applies to tests that use production data

  • uses_ml_model (Boolean)

    Whether the test uses an ML model.

  • uses_production_data (Boolean)

    Whether the test uses production data (monitoring mode only).

  • uses_reference_dataset (Boolean)

    Whether the test uses a reference dataset (monitoring mode only).

  • uses_training_dataset (Boolean)

    Whether the test uses a training dataset.

  • uses_validation_dataset (Boolean)

    Whether the test uses a validation dataset.

  • request_options (Openlayer::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



47
48
49
50
51
52
53
54
55
56
# File 'lib/openlayer/resources/projects/tests.rb', line 47

def create(project_id, params)
  parsed, options = Openlayer::Projects::TestCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["projects/%1$s/tests", project_id],
    body: parsed,
    model: Openlayer::Models::Projects::TestCreateResponse,
    options: options
  )
end

#list(project_id, include_archived: nil, origin_version_id: nil, page: nil, per_page: nil, suggested: nil, type: nil, uses_production_data: nil, request_options: {}) ⇒ Openlayer::Models::Projects::TestListResponse

Some parameter documentations has been truncated, see Models::Projects::TestListParams for more details.

List tests under a project.

Parameters:

  • project_id (String)

    The project id.

  • include_archived (Boolean)

    Filter for archived tests.

  • origin_version_id (String, nil)

    Retrive tests created by a specific project version.

  • page (Integer)

    The page to return in a paginated query.

  • per_page (Integer)

    Maximum number of items to return per page.

  • suggested (Boolean)

    Filter for suggested tests.

  • type (Symbol, Openlayer::Models::Projects::TestListParams::Type)

    Filter objects by test type. Available types are ‘integrity`, `consistency`, `pe

  • uses_production_data (Boolean, nil)

    Retrive tests with usesProductionData (monitoring).

  • request_options (Openlayer::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/openlayer/resources/projects/tests.rb', line 110

def list(project_id, params = {})
  parsed, options = Openlayer::Projects::TestListParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["projects/%1$s/tests", project_id],
    query: parsed.transform_keys(
      include_archived: "includeArchived",
      origin_version_id: "originVersionId",
      per_page: "perPage",
      uses_production_data: "usesProductionData"
    ),
    model: Openlayer::Models::Projects::TestListResponse,
    options: options
  )
end

#update(project_id, payloads: , request_options: {}) ⇒ Openlayer::Models::Projects::TestUpdateResponse

Update tests.

Parameters:

Returns:

See Also:



71
72
73
74
75
76
77
78
79
80
# File 'lib/openlayer/resources/projects/tests.rb', line 71

def update(project_id, params)
  parsed, options = Openlayer::Projects::TestUpdateParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["projects/%1$s/tests", project_id],
    body: parsed,
    model: Openlayer::Models::Projects::TestUpdateResponse,
    options: options
  )
end