Skip to content

Commit 1a1a2ce

Browse files
CLOUDP-219156: Add ability for SDK to flag readonly and write only fields (#253)
1 parent 8fd6736 commit 1a1a2ce

File tree

219 files changed

+943
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+943
-3
lines changed

admin/model_access_list_item.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import (
99
// AccessListItem struct for AccessListItem
1010
type AccessListItem struct {
1111
// Range of IP addresses in Classless Inter-Domain Routing (CIDR) notation that found in this project's access list.
12+
// Read only field.
1213
CidrBlock *string `json:"cidrBlock,omitempty"`
1314
// IP address included in the API access list.
15+
// Read only field.
1416
IpAddress string `json:"ipAddress"`
1517
}
1618

admin/model_advanced_cluster_description.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,28 @@ type AdvancedClusterDescription struct {
1818
ClusterType *string `json:"clusterType,omitempty"`
1919
ConnectionStrings *ClusterConnectionStrings `json:"connectionStrings,omitempty"`
2020
// Date and time when MongoDB Cloud created this cluster. This parameter expresses its value in ISO 8601 format in UTC.
21+
// Read only field.
2122
CreateDate *time.Time `json:"createDate,omitempty"`
2223
// Storage capacity that the host's root volume possesses expressed in gigabytes. Increase this number to add capacity. MongoDB Cloud requires this parameter if you set **replicationSpecs**. If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. Storage charge calculations depend on whether you choose the default value or a custom value. The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier.
2324
DiskSizeGB *float64 `json:"diskSizeGB,omitempty"`
2425
// Cloud service provider that manages your customer keys to provide an additional layer of encryption at rest for the cluster. To enable customer key management for encryption at rest, the cluster **replicationSpecs[n].regionConfigs[m].{type}Specs.instanceSize** setting must be `M10` or higher and `\"backupEnabled\" : false` or omitted entirely.
2526
EncryptionAtRestProvider *string `json:"encryptionAtRestProvider,omitempty"`
2627
// Unique 24-hexadecimal character string that identifies the project.
28+
// Read only field.
2729
GroupId *string `json:"groupId,omitempty"`
2830
// Unique 24-hexadecimal digit string that identifies the replication object for a zone in a Global Cluster. If you include existing zones in the request, you must specify this parameter. If you add a new zone to an existing Global Cluster, you may specify this parameter. The request deletes any existing zones in a Global Cluster that you exclude from the request.
31+
// Read only field.
2932
Id *string `json:"id,omitempty"`
3033
// Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels. Cluster labels are deprecated and will be removed in a future release. We strongly recommend that you use [resource tags](https://dochub.mongodb.org/core/add-cluster-tag-atlas) instead.
3134
// Deprecated
3235
Labels *[]ComponentLabel `json:"labels,omitempty"`
3336
// List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.
37+
// Read only field.
3438
Links *[]Link `json:"links,omitempty"`
3539
// Major MongoDB version of the cluster. MongoDB Cloud deploys the cluster with the latest stable release of the specified version.
3640
MongoDBMajorVersion *string `json:"mongoDBMajorVersion,omitempty"`
3741
// Version of MongoDB that the cluster runs.
42+
// Read only field.
3843
MongoDBVersion *string `json:"mongoDBVersion,omitempty"`
3944
// Human-readable label that identifies the advanced cluster.
4045
Name *string `json:"name,omitempty"`
@@ -47,6 +52,7 @@ type AdvancedClusterDescription struct {
4752
// Root Certificate Authority that MongoDB Cloud cluster uses. MongoDB Cloud supports Internet Security Research Group.
4853
RootCertType *string `json:"rootCertType,omitempty"`
4954
// Human-readable label that indicates the current operating condition of this cluster.
55+
// Read only field.
5056
StateName *string `json:"stateName,omitempty"`
5157
// List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster.
5258
Tags *[]ResourceTag `json:"tags,omitempty"`

admin/model_alert_view_for_nds_group.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,59 @@ type AlertViewForNdsGroup struct {
1414
// Comment that a MongoDB Cloud user submitted when acknowledging the alert.
1515
AcknowledgementComment *string `json:"acknowledgementComment,omitempty"`
1616
// MongoDB Cloud username of the person who acknowledged the alert. The response returns this parameter if a MongoDB Cloud user previously acknowledged this alert.
17+
// Read only field.
1718
AcknowledgingUsername *string `json:"acknowledgingUsername,omitempty"`
1819
// Unique 24-hexadecimal digit string that identifies the alert configuration that sets this alert.
20+
// Read only field.
1921
AlertConfigId *string `json:"alertConfigId,omitempty"`
2022
// Date and time when MongoDB Cloud created this alert. This parameter expresses its value in the <a href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\" rel=\"noopener noreferrer\">ISO 8601</a> timestamp format in UTC.
23+
// Read only field.
2124
Created *time.Time `json:"created,omitempty"`
2225
// Incident that triggered this alert.
26+
// Read only field.
2327
EventTypeName *string `json:"eventTypeName,omitempty"`
2428
// Unique 24-hexadecimal digit string that identifies the project that owns this alert.
29+
// Read only field.
2530
GroupId *string `json:"groupId,omitempty"`
2631
// Unique 24-hexadecimal digit string that identifies this alert.
32+
// Read only field.
2733
Id *string `json:"id,omitempty"`
2834
// Date and time that any notifications were last sent for this alert. This parameter expresses its value in the <a href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\" rel=\"noopener noreferrer\">ISO 8601</a> timestamp format in UTC. The resource returns this parameter if MongoDB Cloud has sent notifications for this alert.
35+
// Read only field.
2936
LastNotified *time.Time `json:"lastNotified,omitempty"`
3037
// List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.
38+
// Read only field.
3139
Links *[]Link `json:"links,omitempty"`
3240
// Unique 24-hexadecimal character string that identifies the organization that owns the project to which this alert applies.
41+
// Read only field.
3342
OrgId *string `json:"orgId,omitempty"`
3443
// Date and time that this alert changed to `\"status\" : \"CLOSED\"`. This parameter expresses its value in the <a href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\" rel=\"noopener noreferrer\">ISO 8601</a> timestamp format in UTC. The resource returns this parameter once `\"status\" : \"CLOSED\"`.
44+
// Read only field.
3545
Resolved *time.Time `json:"resolved,omitempty"`
3646
// State of this alert at the time you requested its details.
47+
// Read only field.
3748
Status *string `json:"status,omitempty"`
3849
// Date and time when someone last updated this alert. This parameter expresses its value in the <a href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\" rel=\"noopener noreferrer\">ISO 8601</a> timestamp format in UTC.
50+
// Read only field.
3951
Updated *time.Time `json:"updated,omitempty"`
4052
// Human-readable label that identifies the cluster to which this alert applies. This resource returns this parameter for alerts of events impacting backups, replica sets, or sharded clusters.
53+
// Read only field.
4154
ClusterName *string `json:"clusterName,omitempty"`
4255
// Hostname and port of the host to which this alert applies. The resource returns this parameter for alerts of events impacting hosts or replica sets.
56+
// Read only field.
4357
HostnameAndPort *string `json:"hostnameAndPort,omitempty"`
4458
// Name of the replica set to which this alert applies. The response returns this parameter for alerts of events impacting backups, hosts, or replica sets.
59+
// Read only field.
4560
ReplicaSetName *string `json:"replicaSetName,omitempty"`
4661
CurrentValue *NumberMetricValue `json:"currentValue,omitempty"`
4762
// Name of the metric against which Atlas checks the configured `metricThreshold.threshold`. To learn more about the available metrics, see <a href=\"https://www.mongodb.com/docs/atlas/reference/alert-host-metrics/#std-label-measurement-types\" target=\"_blank\">Host Metrics</a>. **NOTE**: If you set eventTypeName to OUTSIDE_SERVERLESS_METRIC_THRESHOLD, you can specify only metrics available for serverless. To learn more, see <a href=\"https://dochub.mongodb.org/core/alert-config-serverless-measurements\" target=\"_blank\">Serverless Measurements</a>.
63+
// Read only field.
4864
MetricName *string `json:"metricName,omitempty"`
4965
// List of unique 24-hexadecimal character strings that identify the replica set members that are not in PRIMARY nor SECONDARY state.
66+
// Read only field.
5067
NonRunningHostIds *[]string `json:"nonRunningHostIds,omitempty"`
5168
// Unique 24-hexadecimal character string that identifies the parent cluster to which this alert applies. The parent cluster contains the sharded nodes. MongoDB Cloud returns this parameter only for alerts of events impacting sharded clusters.
69+
// Read only field.
5270
ParentClusterId *string `json:"parentClusterId,omitempty"`
5371
}
5472

admin/model_api_atlas_checkpoint.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,31 @@ import (
1010
// ApiAtlasCheckpoint struct for ApiAtlasCheckpoint
1111
type ApiAtlasCheckpoint struct {
1212
// Unique 24-hexadecimal digit string that identifies the cluster that contains the checkpoint.
13+
// Read only field.
1314
ClusterId *string `json:"clusterId,omitempty"`
1415
// Date and time when the checkpoint completed and the balancer restarted. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
16+
// Read only field.
1517
Completed *time.Time `json:"completed,omitempty"`
1618
// Unique 24-hexadecimal digit string that identifies the project that owns the checkpoints.
19+
// Read only field.
1720
GroupId *string `json:"groupId,omitempty"`
1821
// Unique 24-hexadecimal digit string that identifies checkpoint.
22+
// Read only field.
1923
Id *string `json:"id,omitempty"`
2024
// List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.
25+
// Read only field.
2126
Links *[]Link `json:"links,omitempty"`
2227
// Metadata that describes the complete snapshot. - For a replica set, this array contains a single document. - For a sharded cluster, this array contains one document for each shard plus one document for the config host.
28+
// Read only field.
2329
Parts *[]ApiCheckpointPart `json:"parts,omitempty"`
2430
// Flag that indicates whether MongoDB Cloud can use the checkpoint for a restore.
31+
// Read only field.
2532
Restorable *bool `json:"restorable,omitempty"`
2633
// Date and time when the balancer stopped and began the checkpoint. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
34+
// Read only field.
2735
Started *time.Time `json:"started,omitempty"`
2836
// Date and time to which the checkpoint restores. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
37+
// Read only field.
2938
Timestamp *time.Time `json:"timestamp,omitempty"`
3039
}
3140

admin/model_api_atlas_snapshot_schedule.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ type ApiAtlasSnapshotSchedule struct {
1515
// Quantity of time to keep daily snapshots. MongoDB Cloud expresses this value in days. Set this value to `0` to disable daily snapshot retention.
1616
DailySnapshotRetentionDays int `json:"dailySnapshotRetentionDays"`
1717
// Unique 24-hexadecimal digit string that identifies the project that contains the cluster.
18+
// Read only field.
1819
GroupId string `json:"groupId"`
1920
// List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.
21+
// Read only field.
2022
Links *[]Link `json:"links,omitempty"`
2123
// Number of months that MongoDB Cloud must keep monthly snapshots. Set this value to `0` to disable monthly snapshot retention.
2224
MonthlySnapshotRetentionMonths int `json:"monthlySnapshotRetentionMonths"`

admin/model_api_bson_timestamp.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ import (
1010
// ApiBSONTimestamp BSON timestamp that indicates when the checkpoint token entry in the oplog occurred.
1111
type ApiBSONTimestamp struct {
1212
// Date and time when the oplog recorded this database operation. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
13+
// Read only field.
1314
Date *time.Time `json:"date,omitempty"`
1415
// Order of the database operation that the oplog recorded at specific date and time.
16+
// Read only field.
1517
Increment *int `json:"increment,omitempty"`
1618
}
1719

admin/model_api_checkpoint_part.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ import (
99
// ApiCheckpointPart Metadata contained in one document that describes the complete snapshot taken for this node.
1010
type ApiCheckpointPart struct {
1111
// Human-readable label that identifies the replica set to which this checkpoint applies.
12+
// Read only field.
1213
ReplicaSetName *string `json:"replicaSetName,omitempty"`
1314
// Human-readable label that identifies the shard to which this checkpoint applies.
15+
// Read only field.
1416
ShardName *string `json:"shardName,omitempty"`
1517
// Flag that indicates whether the token exists.
18+
// Read only field.
1619
TokenDiscovered *bool `json:"tokenDiscovered,omitempty"`
1720
TokenTimestamp *ApiBSONTimestamp `json:"tokenTimestamp,omitempty"`
1821
// Human-readable label that identifies the type of host that the part represents.
22+
// Read only field.
1923
TypeName *string `json:"typeName,omitempty"`
2024
}
2125

admin/model_api_host_view_atlas.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,40 @@ import (
1010
// ApiHostViewAtlas struct for ApiHostViewAtlas
1111
type ApiHostViewAtlas struct {
1212
// Date and time when MongoDB Cloud created this MongoDB process. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
13+
// Read only field.
1314
Created *time.Time `json:"created,omitempty"`
1415
// Unique 24-hexadecimal digit string that identifies the project. The project contains MongoDB processes that you want to return. The MongoDB process can be either the `mongod` or `mongos`.
16+
// Read only field.
1517
GroupId *string `json:"groupId,omitempty"`
1618
// Hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`).
19+
// Read only field.
1720
Hostname *string `json:"hostname,omitempty"`
1821
// Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests.
22+
// Read only field.
1923
Id *string `json:"id,omitempty"`
2024
// Date and time when MongoDB Cloud received the last ping for this MongoDB process. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
25+
// Read only field.
2126
LastPing *time.Time `json:"lastPing,omitempty"`
2227
// List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.
28+
// Read only field.
2329
Links *[]LinkAtlas `json:"links,omitempty"`
2430
// Internet Assigned Numbers Authority (IANA) port on which the MongoDB process listens for requests.
31+
// Read only field.
2532
Port *int `json:"port,omitempty"`
2633
// Human-readable label that identifies the replica set that contains this process. This resource returns this parameter if this process belongs to a replica set.
34+
// Read only field.
2735
ReplicaSetName *string `json:"replicaSetName,omitempty"`
2836
// Human-readable label that identifies the shard that contains this process. This resource returns this value only if this process belongs to a sharded cluster.
37+
// Read only field.
2938
ShardName *string `json:"shardName,omitempty"`
3039
// Type of MongoDB process that MongoDB Cloud tracks. MongoDB Cloud returns new processes as **NO_DATA** until MongoDB Cloud completes deploying the process.
40+
// Read only field.
3141
TypeName *string `json:"typeName,omitempty"`
3242
// Human-readable label that identifies the cluster node. MongoDB Cloud sets this hostname usually to the standard hostname for the cluster node. It appears in the connection string for a cluster instead of the value of the hostname parameter.
43+
// Read only field.
3344
UserAlias *string `json:"userAlias,omitempty"`
3445
// Version of MongoDB that this process runs.
46+
// Read only field.
3547
Version *string `json:"version,omitempty"`
3648
}
3749

admin/model_api_key.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ import (
99
// ApiKey Details contained in one API key.
1010
type ApiKey struct {
1111
// List of network addresses granted access to this API using this API key.
12+
// Read only field.
1213
AccessList *[]AccessListItem `json:"accessList,omitempty"`
1314
// Unique 24-hexadecimal digit string that identifies this organization API key.
15+
// Read only field.
1416
Id string `json:"id"`
1517
// Public API key value set for the specified organization API key.
18+
// Read only field.
1619
PublicKey string `json:"publicKey"`
1720
// List that contains roles that the API key needs to have. All roles you provide must be valid for the specified project or organization. Each request must include a minimum of one valid role. The resource returns all project and organization roles assigned to the Cloud user.
21+
// Read only field.
1822
Roles *[]CloudAccessRoleAssignment `json:"roles,omitempty"`
1923
}
2024

admin/model_api_key_user_details.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ type ApiKeyUserDetails struct {
1111
// Purpose or explanation provided when someone created this organization API key.
1212
Desc *string `json:"desc,omitempty"`
1313
// Unique 24-hexadecimal digit string that identifies this organization API key assigned to this project.
14+
// Read only field.
1415
Id *string `json:"id,omitempty"`
1516
// List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.
17+
// Read only field.
1618
Links *[]Link `json:"links,omitempty"`
1719
// Redacted private key returned for this organization API key. This key displays unredacted when first created.
20+
// Read only field.
1821
PrivateKey *string `json:"privateKey,omitempty"`
1922
// Public API key value set for the specified organization API key.
23+
// Read only field.
2024
PublicKey *string `json:"publicKey,omitempty"`
2125
// List that contains the roles that the API key needs to have. All roles you provide must be valid for the specified project or organization. Each request must include a minimum of one valid role. The resource returns all project and organization roles assigned to the API key.
2226
Roles *[]CloudAccessRoleAssignment `json:"roles,omitempty"`

0 commit comments

Comments
 (0)