Class: Stigg::Resources::V1Beta::EntityTypes
- Inherits:
-
Object
- Object
- Stigg::Resources::V1Beta::EntityTypes
- Defined in:
- lib/stigg/resources/v1_beta/entity_types.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ EntityTypes
constructor
private
A new instance of EntityTypes.
-
#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.
-
#upsert(types:, request_options: {}) ⇒ Stigg::Models::V1Beta::EntityTypeUpsertResponse
Batched create-or-update of entity types.
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.
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).
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, = 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: ) 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.
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, = Stigg::V1Beta::EntityTypeUpsertParams.dump_request(params) @client.request( method: :put, path: "api/v1-beta/entity-types", body: parsed, model: Stigg::Models::V1Beta::EntityTypeUpsertResponse, options: ) end |