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

Commit

Permalink
Adding "name" to Cloud Build resource (#236)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and Stuart Paterson committed Oct 30, 2019
1 parent db8c48c commit 8ed43ca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
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

0 comments on commit 8ed43ca

Please sign in to comment.