Class: Stigg::Resources::V1Beta::EntityTypes

Inherits:
Object
  • Object
show all
Defined in:
lib/stigg/resources/v1_beta/entity_types.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ EntityTypes

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 EntityTypes.

Parameters:



64
65
66
# File 'lib/stigg/resources/v1_beta/entity_types.rb', line 64

def initialize(client:)
  @client = client
end

Instance Method Details

#list(after: nil, before: nil, limit: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1Beta::EntityTypeListResponse>

Returns a cursor-paginated list of entity types defined in the environment. Entity types are vendor-defined categories of resource that can be governed (e.g. Org, Team, User).

Parameters:

  • after (String)

    Return items that come after this cursor

  • before (String)

    Return items that come before this cursor

  • limit (Integer)

    Maximum number of items to return

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

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/stigg/resources/v1_beta/entity_types.rb', line 24

def list(params = {})
  parsed, options = Stigg::V1Beta::EntityTypeListParams.dump_request(params)
  query = Stigg::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "api/v1-beta/entity-types",
    query: query,
    page: Stigg::Internal::MyCursorIDPage,
    model: Stigg::Models::V1Beta::EntityTypeListResponse,
    options: options
  )
end

#upsert(types:, request_options: {}) ⇒ Stigg::Models::V1Beta::EntityTypeUpsertResponse

Batched create-or-update of entity types. Existing types matched by id are updated; new ids are created. Idempotent — re-submitting the same payload converges to the same state.

Parameters:

Returns:

See Also:



50
51
52
53
54
55
56
57
58
59
# File 'lib/stigg/resources/v1_beta/entity_types.rb', line 50

def upsert(params)
  parsed, options = Stigg::V1Beta::EntityTypeUpsertParams.dump_request(params)
  @client.request(
    method: :put,
    path: "api/v1-beta/entity-types",
    body: parsed,
    model: Stigg::Models::V1Beta::EntityTypeUpsertResponse,
    options: options
  )
end