Skip to content

Commit 617ac41

Browse files
Create message for user consent. (#124)
1 parent 3be9b2b commit 617ac41

8 files changed

Lines changed: 480 additions & 375 deletions

File tree

gen/go/qdrant/cloud/iam/v1/iam.pb.go

Lines changed: 216 additions & 165 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/openapiv2/qdrant/cloud/account/v1/account.swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@
949949
},
950950
"email": {
951951
"type": "string",
952-
"description": "The email address of the user."
952+
"description": "The email address of the user.\nThis is a read-only field."
953953
},
954954
"status": {
955955
"$ref": "#/definitions/v1UserStatus",

gen/openapiv2/qdrant/cloud/iam/v1/iam.swagger.json

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@
621621
},
622622
"email": {
623623
"type": "string",
624-
"description": "The email address of the user."
624+
"description": "The email address of the user.\nThis is a read-only field."
625625
},
626626
"status": {
627627
"$ref": "#/definitions/v1UserStatus",
@@ -708,22 +708,9 @@
708708
"v1GetUserConsentResponse": {
709709
"type": "object",
710710
"properties": {
711-
"documentType": {
712-
"$ref": "#/definitions/v1LegalDocumentType",
713-
"description": "The type of the legal document for which consent status is reported."
714-
},
715-
"status": {
716-
"$ref": "#/definitions/v1UserConsentStatus",
717-
"description": "The latest consent status recorded from the user for this document type.\nWill be USER_CONSENT_STATUS_UNSPECIFIED if no status update has been recorded."
718-
},
719-
"lastModifiedAt": {
720-
"type": "string",
721-
"format": "date-time",
722-
"description": "Timestamp of the most recent status update.\nUnset if no status update has been recorded."
723-
},
724-
"isAccepted": {
725-
"type": "boolean",
726-
"description": "A convenience field indicating if the current status is an acceptance.\nTrue if status is USER_CONSENT_STATUS_ACCEPTED, false otherwise."
711+
"userConsent": {
712+
"$ref": "#/definitions/v1UserConsent",
713+
"description": "The user consent for the requested document type."
727714
}
728715
},
729716
"description": "GetUserConsentResponse is the response from the GetUserConsent function."
@@ -904,7 +891,7 @@
904891
},
905892
"email": {
906893
"type": "string",
907-
"description": "The email address of the user."
894+
"description": "The email address of the user.\nThis is a read-only field."
908895
},
909896
"status": {
910897
"$ref": "#/definitions/v1UserStatus",
@@ -917,6 +904,29 @@
917904
},
918905
"description": "A User represents a user in the Qdrant cloud."
919906
},
907+
"v1UserConsent": {
908+
"type": "object",
909+
"properties": {
910+
"documentType": {
911+
"$ref": "#/definitions/v1LegalDocumentType",
912+
"description": "The type of the legal document for which consent status is reported."
913+
},
914+
"status": {
915+
"$ref": "#/definitions/v1UserConsentStatus",
916+
"description": "The latest consent status recorded from the user for this document type.\nWill be USER_CONSENT_STATUS_UNSPECIFIED if no status update has been recorded."
917+
},
918+
"lastModifiedAt": {
919+
"type": "string",
920+
"format": "date-time",
921+
"description": "Timestamp of the most recent status update.\nUnset if no status update has been recorded."
922+
},
923+
"isAccepted": {
924+
"type": "boolean",
925+
"description": "A convenience field indicating if the current status is an acceptance.\nTrue if status is USER_CONSENT_STATUS_ACCEPTED, false otherwise."
926+
}
927+
},
928+
"description": "User Consent represents the consent status of a user for a specific legal document."
929+
},
920930
"v1UserConsentStatus": {
921931
"type": "string",
922932
"enum": [

gen/python/qdrant/cloud/iam/v1/iam_pb2.py

Lines changed: 59 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/python/qdrant/cloud/iam/v1/iam_pb2.pyi

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ class UserStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
2020
USER_STATUS_BLOCKED: _ClassVar[UserStatus]
2121
USER_STATUS_DELETED: _ClassVar[UserStatus]
2222

23+
class RoleType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
24+
__slots__ = ()
25+
ROLE_TYPE_UNSPECIFIED: _ClassVar[RoleType]
26+
ROLE_TYPE_SYSTEM: _ClassVar[RoleType]
27+
ROLE_TYPE_CUSTOM: _ClassVar[RoleType]
28+
2329
class LegalDocumentType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
2430
__slots__ = ()
2531
LEGAL_DOCUMENT_TYPE_UNSPECIFIED: _ClassVar[LegalDocumentType]
@@ -33,16 +39,13 @@ class UserConsentStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
3339
USER_CONSENT_STATUS_ACCEPTED: _ClassVar[UserConsentStatus]
3440
USER_CONSENT_STATUS_REVOKED: _ClassVar[UserConsentStatus]
3541
USER_CONSENT_STATUS_PENDING: _ClassVar[UserConsentStatus]
36-
37-
class RoleType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
38-
__slots__ = ()
39-
ROLE_TYPE_UNSPECIFIED: _ClassVar[RoleType]
40-
ROLE_TYPE_SYSTEM: _ClassVar[RoleType]
41-
ROLE_TYPE_CUSTOM: _ClassVar[RoleType]
4242
USER_STATUS_UNSPECIFIED: UserStatus
4343
USER_STATUS_ACTIVE: UserStatus
4444
USER_STATUS_BLOCKED: UserStatus
4545
USER_STATUS_DELETED: UserStatus
46+
ROLE_TYPE_UNSPECIFIED: RoleType
47+
ROLE_TYPE_SYSTEM: RoleType
48+
ROLE_TYPE_CUSTOM: RoleType
4649
LEGAL_DOCUMENT_TYPE_UNSPECIFIED: LegalDocumentType
4750
LEGAL_DOCUMENT_TYPE_TERMS_OF_SERVICE: LegalDocumentType
4851
LEGAL_DOCUMENT_TYPE_PRIVACY_POLICY: LegalDocumentType
@@ -51,9 +54,6 @@ USER_CONSENT_STATUS_UNSPECIFIED: UserConsentStatus
5154
USER_CONSENT_STATUS_ACCEPTED: UserConsentStatus
5255
USER_CONSENT_STATUS_REVOKED: UserConsentStatus
5356
USER_CONSENT_STATUS_PENDING: UserConsentStatus
54-
ROLE_TYPE_UNSPECIFIED: RoleType
55-
ROLE_TYPE_SYSTEM: RoleType
56-
ROLE_TYPE_CUSTOM: RoleType
5757

5858
class GetAuthenticatedUserRequest(_message.Message):
5959
__slots__ = ()
@@ -84,16 +84,10 @@ class GetUserConsentRequest(_message.Message):
8484
def __init__(self, document_type: _Optional[_Union[LegalDocumentType, str]] = ...) -> None: ...
8585

8686
class GetUserConsentResponse(_message.Message):
87-
__slots__ = ("document_type", "status", "last_modified_at", "is_accepted")
88-
DOCUMENT_TYPE_FIELD_NUMBER: _ClassVar[int]
89-
STATUS_FIELD_NUMBER: _ClassVar[int]
90-
LAST_MODIFIED_AT_FIELD_NUMBER: _ClassVar[int]
91-
IS_ACCEPTED_FIELD_NUMBER: _ClassVar[int]
92-
document_type: LegalDocumentType
93-
status: UserConsentStatus
94-
last_modified_at: _timestamp_pb2.Timestamp
95-
is_accepted: bool
96-
def __init__(self, document_type: _Optional[_Union[LegalDocumentType, str]] = ..., status: _Optional[_Union[UserConsentStatus, str]] = ..., last_modified_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., is_accepted: bool = ...) -> None: ...
87+
__slots__ = ("user_consent",)
88+
USER_CONSENT_FIELD_NUMBER: _ClassVar[int]
89+
user_consent: UserConsent
90+
def __init__(self, user_consent: _Optional[_Union[UserConsent, _Mapping]] = ...) -> None: ...
9791

9892
class RecordUserConsentRequest(_message.Message):
9993
__slots__ = ("document_type", "status_update")
@@ -258,3 +252,15 @@ class Role(_message.Message):
258252
role_type: RoleType
259253
permissions: _containers.RepeatedScalarFieldContainer[str]
260254
def __init__(self, id: _Optional[str] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., last_modified_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., account_id: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., role_type: _Optional[_Union[RoleType, str]] = ..., permissions: _Optional[_Iterable[str]] = ...) -> None: ...
255+
256+
class UserConsent(_message.Message):
257+
__slots__ = ("document_type", "status", "last_modified_at", "is_accepted")
258+
DOCUMENT_TYPE_FIELD_NUMBER: _ClassVar[int]
259+
STATUS_FIELD_NUMBER: _ClassVar[int]
260+
LAST_MODIFIED_AT_FIELD_NUMBER: _ClassVar[int]
261+
IS_ACCEPTED_FIELD_NUMBER: _ClassVar[int]
262+
document_type: LegalDocumentType
263+
status: UserConsentStatus
264+
last_modified_at: _timestamp_pb2.Timestamp
265+
is_accepted: bool
266+
def __init__(self, document_type: _Optional[_Union[LegalDocumentType, str]] = ..., status: _Optional[_Union[UserConsentStatus, str]] = ..., last_modified_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., is_accepted: bool = ...) -> None: ...

gen/typescript/qdrant/cloud/iam/v1/iam_pb.d.ts

Lines changed: 82 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -115,35 +115,11 @@ export declare const GetUserConsentRequestSchema: GenMessage<GetUserConsentReque
115115
*/
116116
export declare type GetUserConsentResponse = Message<"qdrant.cloud.iam.v1.GetUserConsentResponse"> & {
117117
/**
118-
* The type of the legal document for which consent status is reported.
119-
*
120-
* @generated from field: qdrant.cloud.iam.v1.LegalDocumentType document_type = 1;
121-
*/
122-
documentType: LegalDocumentType;
123-
124-
/**
125-
* The latest consent status recorded from the user for this document type.
126-
* Will be USER_CONSENT_STATUS_UNSPECIFIED if no status update has been recorded.
127-
*
128-
* @generated from field: qdrant.cloud.iam.v1.UserConsentStatus status = 2;
129-
*/
130-
status: UserConsentStatus;
131-
132-
/**
133-
* Timestamp of the most recent status update.
134-
* Unset if no status update has been recorded.
118+
* The user consent for the requested document type.
135119
*
136-
* @generated from field: optional google.protobuf.Timestamp last_modified_at = 3;
137-
*/
138-
lastModifiedAt?: Timestamp;
139-
140-
/**
141-
* A convenience field indicating if the current status is an acceptance.
142-
* True if status is USER_CONSENT_STATUS_ACCEPTED, false otherwise.
143-
*
144-
* @generated from field: bool is_accepted = 4;
120+
* @generated from field: qdrant.cloud.iam.v1.UserConsent user_consent = 1;
145121
*/
146-
isAccepted: boolean;
122+
userConsent?: UserConsent;
147123
};
148124

149125
/**
@@ -639,6 +615,7 @@ export declare type User = Message<"qdrant.cloud.iam.v1.User"> & {
639615

640616
/**
641617
* The email address of the user.
618+
* This is a read-only field.
642619
*
643620
* @generated from field: string email = 4;
644621
*/
@@ -742,6 +719,50 @@ export declare type Role = Message<"qdrant.cloud.iam.v1.Role"> & {
742719
*/
743720
export declare const RoleSchema: GenMessage<Role>;
744721

722+
/**
723+
* User Consent represents the consent status of a user for a specific legal document.
724+
*
725+
* @generated from message qdrant.cloud.iam.v1.UserConsent
726+
*/
727+
export declare type UserConsent = Message<"qdrant.cloud.iam.v1.UserConsent"> & {
728+
/**
729+
* The type of the legal document for which consent status is reported.
730+
*
731+
* @generated from field: qdrant.cloud.iam.v1.LegalDocumentType document_type = 1;
732+
*/
733+
documentType: LegalDocumentType;
734+
735+
/**
736+
* The latest consent status recorded from the user for this document type.
737+
* Will be USER_CONSENT_STATUS_UNSPECIFIED if no status update has been recorded.
738+
*
739+
* @generated from field: qdrant.cloud.iam.v1.UserConsentStatus status = 2;
740+
*/
741+
status: UserConsentStatus;
742+
743+
/**
744+
* Timestamp of the most recent status update.
745+
* Unset if no status update has been recorded.
746+
*
747+
* @generated from field: optional google.protobuf.Timestamp last_modified_at = 3;
748+
*/
749+
lastModifiedAt?: Timestamp;
750+
751+
/**
752+
* A convenience field indicating if the current status is an acceptance.
753+
* True if status is USER_CONSENT_STATUS_ACCEPTED, false otherwise.
754+
*
755+
* @generated from field: bool is_accepted = 4;
756+
*/
757+
isAccepted: boolean;
758+
};
759+
760+
/**
761+
* Describes the message qdrant.cloud.iam.v1.UserConsent.
762+
* Use `create(UserConsentSchema)` to create a new message.
763+
*/
764+
export declare const UserConsentSchema: GenMessage<UserConsent>;
765+
745766
/**
746767
* UserStatus defines the possible statuses of a user.
747768
*
@@ -782,6 +803,40 @@ export enum UserStatus {
782803
*/
783804
export declare const UserStatusSchema: GenEnum<UserStatus>;
784805

806+
/**
807+
* RoleType specified the type of the role
808+
*
809+
* @generated from enum qdrant.cloud.iam.v1.RoleType
810+
*/
811+
export enum RoleType {
812+
/**
813+
* The role type is unspecified.
814+
*
815+
* @generated from enum value: ROLE_TYPE_UNSPECIFIED = 0;
816+
*/
817+
UNSPECIFIED = 0,
818+
819+
/**
820+
* The role type is system.
821+
* Note: system roles cannot be changed (create/update/delete).
822+
*
823+
* @generated from enum value: ROLE_TYPE_SYSTEM = 1;
824+
*/
825+
SYSTEM = 1,
826+
827+
/**
828+
* The role type is custom defined.
829+
*
830+
* @generated from enum value: ROLE_TYPE_CUSTOM = 2;
831+
*/
832+
CUSTOM = 2,
833+
}
834+
835+
/**
836+
* Describes the enum qdrant.cloud.iam.v1.RoleType.
837+
*/
838+
export declare const RoleTypeSchema: GenEnum<RoleType>;
839+
785840
/**
786841
* LegalDocumentType specifies the type of a legal document.
787842
*
@@ -864,40 +919,6 @@ export enum UserConsentStatus {
864919
*/
865920
export declare const UserConsentStatusSchema: GenEnum<UserConsentStatus>;
866921

867-
/**
868-
* RoleType specified the type of the role
869-
*
870-
* @generated from enum qdrant.cloud.iam.v1.RoleType
871-
*/
872-
export enum RoleType {
873-
/**
874-
* The role type is unspecified.
875-
*
876-
* @generated from enum value: ROLE_TYPE_UNSPECIFIED = 0;
877-
*/
878-
UNSPECIFIED = 0,
879-
880-
/**
881-
* The role type is system.
882-
* Note: system roles cannot be changed (create/update/delete).
883-
*
884-
* @generated from enum value: ROLE_TYPE_SYSTEM = 1;
885-
*/
886-
SYSTEM = 1,
887-
888-
/**
889-
* The role type is custom defined.
890-
*
891-
* @generated from enum value: ROLE_TYPE_CUSTOM = 2;
892-
*/
893-
CUSTOM = 2,
894-
}
895-
896-
/**
897-
* Describes the enum qdrant.cloud.iam.v1.RoleType.
898-
*/
899-
export declare const RoleTypeSchema: GenEnum<RoleType>;
900-
901922
/**
902923
* IAMService is the API used to configure IAM (identity and access management) objects.
903924
*

0 commit comments

Comments
 (0)