Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Adding "name" to Cloud Build resource #236

Merged
merged 1 commit into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/resources/google_cloudbuild_trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Properties that can be accessed from the `google_cloudbuild_trigger` resource:

* `id`: The unique identifier for the trigger.

* `name`: Name of the trigger. Must be unique within the project.

* `description`: Human-readable description of the trigger.

* `disabled`: Whether the trigger is disabled or not. If true, the trigger will never result in a build.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/google_cloudbuild_triggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Properties that can be accessed from the `google_cloudbuild_triggers` resource:

See [google_cloudbuild_trigger.md](google_cloudbuild_trigger.md) for more detailed information
* `ids`: an array of `google_cloudbuild_trigger` id
* `names`: an array of `google_cloudbuild_trigger` name
* `descriptions`: an array of `google_cloudbuild_trigger` description
* `disableds`: an array of `google_cloudbuild_trigger` disabled
* `create_times`: an array of `google_cloudbuild_trigger` create_time
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_cloudbuild_trigger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class CloudBuildTrigger < GcpResourceBase

attr_reader :params
attr_reader :id
attr_reader :name
attr_reader :description
attr_reader :disabled
attr_reader :create_time
Expand All @@ -45,6 +46,7 @@ def initialize(params)

def parse
@id = @fetched['id']
@name = @fetched['name']
@description = @fetched['description']
@disabled = @fetched['disabled']
@create_time = parse_time_string(@fetched['createTime'])
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_cloudbuild_triggers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class CloudBuildTriggers < GcpResourceBase
filter_table_config = FilterTable.create

filter_table_config.add(:ids, field: :id)
filter_table_config.add(:names, field: :name)
filter_table_config.add(:descriptions, field: :description)
filter_table_config.add(:disableds, field: :disabled)
filter_table_config.add(:create_times, field: :create_time)
Expand Down Expand Up @@ -73,6 +74,7 @@ def transform(key, value)
def transformers
{
'id' => ->(obj) { return :id, obj['id'] },
'name' => ->(obj) { return :name, obj['name'] },
'description' => ->(obj) { return :description, obj['description'] },
'disabled' => ->(obj) { return :disabled, obj['disabled'] },
'createTime' => ->(obj) { return :create_time, parse_time_string(obj['createTime']) },
Expand Down