Repository: cloudflare/cloudflare-go
Pull request #1181 (2023-01-23 20:10:21)

Add ui_read_only_toggle_reason to Access organization
## Description

Adds the `ui_read_only_toggle_reason` field to the Access organization. API docs will be publicly released soon.

## Types of changes

What sort of change does your code introduce/modify?

- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)


github-actions[bot]: Oops! It looks like no changelog entry is attached to this PR. Please include a release note as described in https://github.com/cloudflare/cloudflare-go/blob/master/docs/changelog-process.md.

Example: 

~~~
```release-note:TYPE
Release note
```
~~~

If you do not require a release note to be included, please add the `workflow/skip-changelog-entry` label.
codecov-commenter: # [Codecov](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare) Report
> Merging [#1181](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare) (e1dfb01) into [master](https://codecov.io/gh/cloudflare/cloudflare-go/commit/6153c1e32fa46b7049683687b7f76eb554c95217?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare) (6153c1e) will **decrease** coverage by `0.05%`.
> The diff coverage is `49.38%`.

```diff
@@            Coverage Diff             @@
##           master    #1181      +/-   ##
==========================================
- Coverage   49.40%   49.36%   -0.05%     
==========================================
  Files         127      128       +1     
  Lines       12290    12436     +146     
==========================================
+ Hits         6072     6139      +67     
- Misses       4840     4893      +53     
- Partials     1378     1404      +26     
```


| [Impacted Files](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare) | Coverage Δ | |
|---|---|---|
| [access\_organization.go](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare#diff-YWNjZXNzX29yZ2FuaXphdGlvbi5nbw==) | `64.70% <ø> (ø)` | |
| [cloudflare\_experimental.go](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare#diff-Y2xvdWRmbGFyZV9leHBlcmltZW50YWwuZ28=) | `0.00% <0.00%> (ø)` | |
| [teams\_rules.go](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare#diff-dGVhbXNfcnVsZXMuZ28=) | `44.94% <0.00%> (-0.52%)` | :arrow_down: |
| [utils.go](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare#diff-dXRpbHMuZ28=) | `72.72% <ø> (ø)` | |
| [cloudflare.go](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare#diff-Y2xvdWRmbGFyZS5nbw==) | `68.37% <14.28%> (-0.34%)` | :arrow_down: |
| [mtls\_certificates.go](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare#diff-bXRsc19jZXJ0aWZpY2F0ZXMuZ28=) | `26.59% <26.59%> (ø)` | |
| [workers\_bindings.go](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare#diff-d29ya2Vyc19iaW5kaW5ncy5nbw==) | `67.44% <40.00%> (-2.31%)` | :arrow_down: |
| [origin\_ca.go](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare#diff-b3JpZ2luX2NhLmdv) | `57.26% <90.90%> (-2.09%)` | :arrow_down: |
| [dns.go](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare#diff-ZG5zLmdv) | `72.72% <96.36%> (+9.00%)` | :arrow_up: |
| [devices\_managed\_networks.go](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare#diff-ZGV2aWNlc19tYW5hZ2VkX25ldHdvcmtzLmdv) | `41.55% <100.00%> (+9.09%)` | :arrow_up: |
| ... and [11 more](https://codecov.io/gh/cloudflare/cloudflare-go/pull/1181?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare) | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cloudflare)


Patch:
diff --git a/.changelog/1181.txt b/.changelog/1181.txt
new file mode 100644
index 000000000..355b67584
--- /dev/null
+++ b/.changelog/1181.txt
@@ -0,0 +1,3 @@
+```release-note:enhancement
+access_organization: add ui_read_only_toggle_reason field
+```
diff --git a/access_organization.go b/access_organization.go
index 35c9e9e37..f4de4a7b6 100644
--- a/access_organization.go
+++ b/access_organization.go
@@ -16,6 +16,7 @@ type AccessOrganization struct {
 	AuthDomain                     string                        `json:"auth_domain"`
 	LoginDesign                    AccessOrganizationLoginDesign `json:"login_design"`
 	IsUIReadOnly                   *bool                         `json:"is_ui_read_only,omitempty"`
+	UIReadOnlyToggleReason         string                        `json:"ui_read_only_toggle_reason,omitempty"`
 	UserSeatExpirationInactiveTime string                        `json:"user_seat_expiration_inactive_time,omitempty"`
 }
 


Test patch:
diff --git a/access_organization_test.go b/access_organization_test.go
index f09a0a37e..7d6cfa60e 100644
--- a/access_organization_test.go
+++ b/access_organization_test.go
@@ -163,7 +163,8 @@ func TestUpdateAccessOrganization(t *testing.T) {
 					"header_text": "Widget Corp",
 					"footer_text": "© Widget Corp"
 				},
-				"is_ui_read_only": false
+				"is_ui_read_only": false,
+				"ui_read_only_toggle_reason": "this is my reason"
 			}
 		}
 		`)
@@ -184,7 +185,8 @@ func TestUpdateAccessOrganization(t *testing.T) {
 			HeaderText:      "Widget Corp",
 			FooterText:      "© Widget Corp",
 		},
-		IsUIReadOnly: BoolPtr(false),
+		IsUIReadOnly:           BoolPtr(false),
+		UIReadOnlyToggleReason: "this is my reason",
 	}
 
 	mux.HandleFunc("/accounts/"+testAccountID+"/access/organizations", handler)