-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom flattener for diagflowcx agent git integration settings fi…
…eld (#9597) * Add a custom flattener for the parent field * Update mmv1/templates/terraform/custom_flatten/dialogflowcx_agent_git_integration_settings_github_settings.go.erb Co-authored-by: Stephen Lewis (Burrows) <[email protected]> --------- Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
- Loading branch information
Showing
3 changed files
with
33 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...rraform/custom_flatten/dialogflowcx_agent_git_integration_settings_github_settings.go.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<%# The license inside this block applies to this file. | ||
# Copyright 2018 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
-%> | ||
func flattenDialogflowCXAgentGitIntegrationSettingsGithubSettings(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} { | ||
if v == nil { | ||
return nil | ||
} | ||
original := v.(map[string]interface{}) | ||
// ignore access_token, which is always returned as REDACTED | ||
delete(original, "access_token"); | ||
if len(original) == 0 { | ||
return nil | ||
} | ||
transformed := make(map[string]interface{}) | ||
transformed["display_name"] = original["displayName"] | ||
transformed["repository_uri"] = original["repositoryUri"] | ||
transformed["tracking_branch"] = original["trackingBranch"] | ||
transformed["access_token"] = d.Get("git_integration_settings.0.github_settings.0.access_token") | ||
transformed["branches"] = original["branches"] | ||
return []interface{}{transformed} | ||
} |
17 changes: 0 additions & 17 deletions
17
...m_flatten/dialogflowcx_agent_git_integration_settings_github_settings_access_token.go.erb
This file was deleted.
Oops, something went wrong.