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, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1Beta::EntityTypeListResponse>
Some parameter documentations has been truncated, see Models::V1Beta::EntityTypeListParams for more details.
-
#upsert(types:, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1Beta::EntityTypeUpsertResponse
Some parameter documentations has been truncated, see Models::V1Beta::EntityTypeUpsertParams for more details.
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.
85 86 87 |
# File 'lib/stigg/resources/v1_beta/entity_types.rb', line 85 def initialize(client:) @client = client end |
Instance Method Details
#list(after: nil, before: nil, limit: nil, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1Beta::EntityTypeListResponse>
Some parameter documentations has been truncated, see Models::V1Beta::EntityTypeListParams for more details.
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).
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/stigg/resources/v1_beta/entity_types.rb', line 31 def list(params = {}) query_params = [:after, :before, :limit] parsed, = Stigg::V1Beta::EntityTypeListParams.dump_request(params) query = Stigg::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "api/v1-beta/entity-types", query: query, headers: parsed.except(*query_params).transform_keys( x_account_id: "x-account-id", x_environment_id: "x-environment-id" ), page: Stigg::Internal::MyCursorIDPage, model: Stigg::Models::V1Beta::EntityTypeListResponse, options: ) end |
#upsert(types:, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1Beta::EntityTypeUpsertResponse
Some parameter documentations has been truncated, see Models::V1Beta::EntityTypeUpsertParams for more details.
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.
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/stigg/resources/v1_beta/entity_types.rb', line 69 def upsert(params) parsed, = Stigg::V1Beta::EntityTypeUpsertParams.dump_request(params) header_params = {x_account_id: "x-account-id", x_environment_id: "x-environment-id"} @client.request( method: :put, path: "api/v1-beta/entity-types", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Stigg::Models::V1Beta::EntityTypeUpsertResponse, options: ) end |